Skip to content

Commit

Permalink
Merge pull request #1 from CareerPlug/i_CP-4249_fix_nil_pointer_error
Browse files Browse the repository at this point in the history
[CP-4249] Ensure contents.html_safe does not blow up
  • Loading branch information
bartimez authored Jun 22, 2023
2 parents 15f5b14 + 26d84d4 commit af62178
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def field_set_and_list_wrapping(*args, &block) #:nodoc:
# Ruby 1.9: String#to_s behavior changed, need to make an explicit join.
contents = contents.join if contents.respond_to?(:join)

legend = field_set_legend(html_options)
fieldset = template.content_tag(:fieldset,
legend.html_safe << contents.html_safe,
legend = field_set_legend(html_options).html_safe
legend << contents.html_safe if contents.present?

template.content_tag(
:fieldset,
legend,
html_options.except(:builder, :parent, :name)
)

fieldset
end

end
end
end

0 comments on commit af62178

Please sign in to comment.