aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/welcome_controller.rb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-09 11:46:05 +0200
committerhellekin <hellekin@cepheide.org>2020-10-09 11:46:49 +0200
commitf193e708285db21e9e3dffbe96c9961a9865e2db (patch)
tree4eea900f5c4b0d3368a3c64816f9a0bbe36cb6ae /app/controllers/welcome_controller.rb
parentd7030931a48c270c78181bee02613c1211e0d4fd (diff)
downloadincommon-map-f193e708285db21e9e3dffbe96c9961a9865e2db.tar.gz
Avoid errors on missing Taxonomy
Diffstat (limited to 'app/controllers/welcome_controller.rb')
-rw-r--r--app/controllers/welcome_controller.rb8
1 files changed, 4 insertions, 4 deletions
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 } }