From b97297c6b2a4b97e5b63dd753188bcec68d3050e Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+github@gmail.com>
Date: Tue, 25 Jan 2022 11:12:58 +0100
Subject: [PATCH] fixes #580

---
 lib/plugins/db/RolePersistence.class.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/plugins/db/RolePersistence.class.php b/lib/plugins/db/RolePersistence.class.php
index a66b9a0be23..a0d01d5a4f0 100644
--- a/lib/plugins/db/RolePersistence.class.php
+++ b/lib/plugins/db/RolePersistence.class.php
@@ -198,6 +198,10 @@ class RolePersistence
      */
     public static function isAssignedRole($userid, $assignedrole, $institut_id = '')
     {
+        if (!$userid) {
+            return false;
+        }
+
         $faculty_id = $institut_id
                     ? Institute::find($institut_id)->fakultaets_id
                     : null;
-- 
GitLab