Skip to content

Commit

Permalink
Fix empty string rendering inverted sections
Browse files Browse the repository at this point in the history
  • Loading branch information
RadicalZephyr committed Jul 20, 2020
1 parent 282eb88 commit 0b376ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mustache/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def on_inverted_section(name, offset, content, raw, delims)
# what's inside.
ev(<<-compiled)
v = #{compile!(name)}
if v.nil? || v == false || v.respond_to?(:empty?) && v.empty?
if v.nil? || v == false || (v.class != String && v.respond_to?(:empty?) && v.empty?)
#{code}
end
compiled
Expand Down

0 comments on commit 0b376ad

Please sign in to comment.