fix scope nil in test context

Julien Girard committed May 02, 2018
commit fb7a1cb20fe7591d73ff534289b1dc063b589c34
Showing 1 changed file with 1 additions and 1 deletions
locomotive/steam/liquid/tags/section.rb b/lib/locomotive/steam/liquid/tags/section.rb +1 -1
@@ @@ -17,7 +17,7 @@ module Locomotive
# 3. because it's considered as a static section, go get the content from
# the current site. If it doesn't exist, use the default attribute of
# the section
- section_content = context["site"].sections[@template_name]
+ section_content = context['site']&.sections&.fetch(@template_name, nil) #context["site"].sections[@template_name]
if section_content.blank?
section_content = section.definition[:default] || {}