From 1019c7803cb3b8a28537728f9227c1f2c4aa5668 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Tue, 8 Jan 2013 19:40:50 -0800 Subject: [PATCH] Fix error with link_to when options are nil --- .../core_extensions/default_helpers.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb b/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb index 78c4b50e..4b30967c 100644 --- a/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb +++ b/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb @@ -181,14 +181,13 @@ module Middleman end end end - end - # Support a :query option that can be a string or hash - query = options.delete(:query) - if query - uri = URI(args[url_arg_index]) - uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s - args[url_arg_index] = uri.to_s + # Support a :query option that can be a string or hash + if query = options.delete(:query) + uri = URI(args[url_arg_index]) + uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s + args[url_arg_index] = uri.to_s + end end super(*args, &block)