Fix error with link_to when options are nil

This commit is contained in:
Ben Hollis 2013-01-08 19:40:50 -08:00 committed by Thomas Reynolds
parent 3521b7527b
commit df539e2743

View file

@ -176,14 +176,13 @@ module Middleman
end end
end end
end end
end
# Support a :query option that can be a string or hash # Support a :query option that can be a string or hash
query = options.delete(:query) if query = options.delete(:query)
if query uri = URI(args[url_arg_index])
uri = URI(args[url_arg_index]) uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s
uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s args[url_arg_index] = uri.to_s
args[url_arg_index] = uri.to_s end
end end
super(*args, &block) super(*args, &block)