Skip to content

Commit 820b1b9

Browse files
committed
Use safe navigation when getting titles
1 parent 821bfd9 commit 820b1b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/app/helpers/refinery/meta_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def page_title(options = {})
2121
objects = (options[:chain_page_title] and object.respond_to?(:ancestors)) ? [object.ancestors, object] : [object]
2222

2323
objects.flatten.compact.each do |obj|
24-
obj_title = obj.title if obj.title
24+
obj_title = obj&.title.presence
2525

2626
# Only link when the object responds to a url method.
2727
if options[:link] && obj.respond_to?(:url)

images/app/views/refinery/admin/images/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@
113113
<% end %>
114114

115115
<% content_for :stylesheets, stylesheet_link_tag('cropper') -%>
116-
<% end %>
116+
<% end %>

0 commit comments

Comments
 (0)