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:
evazion
2020-02-05 18:36:55 -06:00
parent 69f653b0c4
commit 960ed8934b

View File

@@ -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