Skip to content

Commit

Permalink
prevent nil errors
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt authored and donv committed Apr 29, 2022
1 parent 7861e5a commit a40ef76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bootstrap_form/components/labels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def label_text(name, options)
if label_errors && error?(name)
(options[:text] || object.class.human_attribute_name(name)).to_s.concat(" #{get_error_messages(name)}")
else
options[:text] || object.class.human_attribute_name(name)
options[:text] || object&.class&.human_attribute_name(name)
end
end
end
Expand Down

0 comments on commit a40ef76

Please sign in to comment.