From 41c0bf52d131ae41716aafce4ee6a4c27b40f714 Mon Sep 17 00:00:00 2001
From: Manuel Kocher <manuel.kocher@tugraz.at>
Date: Mon, 30 Jan 2023 16:16:23 +0100
Subject: [PATCH] Better error handling for constructor launched auth property
 event

---
 packages/app-shell/src/app-shell.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js
index 51653a68..e62935cb 100644
--- a/packages/app-shell/src/app-shell.js
+++ b/packages/app-shell/src/app-shell.js
@@ -73,7 +73,7 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
         this.boundCloseMenuHandler = this.hideMenu.bind(this);
         this.initateOpenMenu = false;
 
-        this.auth = {};
+        this.auth = null;
         this.langDir = '';
     }
 
@@ -332,6 +332,11 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
                     break;
                 case 'auth':
                     {
+                        // kill event if auth gets default
+                        if (this.auth === null) {
+                            break;
+                        }
+
                         if (this.auth.person) {
                             this._roles = this.auth.person['roles'];
                         } else {
-- 
GitLab