From f4980c87682f8600c741543304c3c745f7e7beeb Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 18 Aug 2020 13:59:45 +0100 Subject: [PATCH] handling instance when category might be nil --- config/initializers/comfy_patching.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/comfy_patching.rb b/config/initializers/comfy_patching.rb index 2cfb1c0fe..10c4b5c27 100644 --- a/config/initializers/comfy_patching.rb +++ b/config/initializers/comfy_patching.rb @@ -144,7 +144,7 @@ def import_page(path, parent) fragments_attributes.select { |attr| attr[:tag] == 'categories'}.each do |cat| cat[:content].split(' ').each do |label| category = Comfy::Cms::PageCategory.where(label: label).first - new_categories << category + new_categories << category unless category.nil? end end