From 960ed8934ba7d0f548b713aebda61faf51083613 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 5 Feb 2020 18:36:55 -0600 Subject: [PATCH] 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. --- app/models/tag.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/tag.rb b/app/models/tag.rb index e6cec3c50..0bf82bb48 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -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