From f193e708285db21e9e3dffbe96c9961a9865e2db Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 9 Oct 2020 11:46:05 +0200 Subject: Avoid errors on missing Taxonomy --- app/controllers/welcome_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index ee73270..0c41e5a 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -62,10 +62,10 @@ class WelcomeController < ApplicationController name: current_agent.name, uuid: current_agent.uuid, counts: { - resources: current_agent.resources.count, - taxonomies: current_agent.taxonomies.count, - categories: current_agent.categories.count, - sectiions: current_agent.sections.count + resources: current_agent.resources&.count, + taxonomies: current_agent.taxonomies&.count, + categories: current_agent.categories&.count, + sectiions: current_agent.sections&.count } }, my_agents: current_user.agents.map { |a| { uuid: a.uuid, name: a.name } } -- cgit v1.2.3