From b6fb7ae54fa280eaa76f08868c724169a300e945 Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 18 Jul 2013 14:36:56 -0700 Subject: [PATCH] Fix undefined method `sort_by' error from vhost_location_empty.erb In the template, we should check if the variable is defined before use it --- templates/vhost/vhost_location_empty.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/vhost/vhost_location_empty.erb b/templates/vhost/vhost_location_empty.erb index 420f5c6..ce53e18 100644 --- a/templates/vhost/vhost_location_empty.erb +++ b/templates/vhost/vhost_location_empty.erb @@ -1,5 +1,5 @@ location <%= @location %> { -<% @location_custom_cfg.sort_by {|k,v| k}.each do |key,value| -%> +<% if @location_custom_cfg -%><% @location_custom_cfg.sort_by {|k,v| k}.each do |key,value| -%> <%= key %> <%= value %>; -<% end -%> +<% end -%><% end -%> }