From a33ef2072618911e2adcebba8c9de391cfc02096 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 ee075b44..fe44eda5 100644 --- a/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb +++ b/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb @@ -176,14 +176,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)