From 844f96d146758fd516afb46a715a8ff94650551d Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 16 Sep 2019 11:35:45 -0700 Subject: [PATCH] FIX: ensures user has groups --- .../discourse/components/group-reports-nav-item.js.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 b/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 index 6280436..04c3d9c 100644 --- a/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 +++ b/assets/javascripts/discourse/components/group-reports-nav-item.js.es6 @@ -12,10 +12,13 @@ export default Ember.Component.extend({ init(args) { this.set("group", args.group); - if (this.currentUser.groups.some(g => g.id === this.group.id)) { + if ( + (this.get("currentUser.groups") || []).some(g => g.id === this.group.id) + ) { // User is a part of the group. Now check if the group has reports this.checkForReports(); } + this._super(args); } });