wiki_pages/new: fix exception in rendering html data attributes.
Fix exception when trying to get the category_name for the html data attributes. The wiki title is nil here and Tag.category_for couldn't handle a nil tag name.
This commit is contained in:
@@ -158,6 +158,8 @@ class Tag < ApplicationRecord
|
||||
end
|
||||
|
||||
def category_for(tag_name, options = {})
|
||||
return Tag.categories.general if tag_name.blank?
|
||||
|
||||
if options[:disable_caching]
|
||||
select_category_for(tag_name)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user