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
This commit is contained in:
Pan 2013-07-18 14:36:56 -07:00
parent 9c7712a190
commit b6fb7ae54f

View file

@ -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 -%>
}