From 8e37c9f24d366dabe1de5a94dc97e11d390a8ffc Mon Sep 17 00:00:00 2001 From: "Shamiso.Jaravaza" <33659194+ssj365@users.noreply.github.com> Date: Wed, 14 Sep 2022 09:08:55 -0600 Subject: [PATCH] MDL-74965 mod_bigbluebuttonbn: Fix error in role --- mod/bigbluebuttonbn/classes/local/helpers/roles.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/bigbluebuttonbn/classes/local/helpers/roles.php b/mod/bigbluebuttonbn/classes/local/helpers/roles.php index f77185970ae..5d01181148c 100644 --- a/mod/bigbluebuttonbn/classes/local/helpers/roles.php +++ b/mod/bigbluebuttonbn/classes/local/helpers/roles.php @@ -184,9 +184,9 @@ class roles { * * @param string|integer $id * - * @return stdClass $role + * @return stdClass|null $role */ - protected static function get_role($id): stdClass { + protected static function get_role($id): ?stdClass { $roles = (array) role_get_names(); if (is_numeric($id) && isset($roles[$id])) { return (object) $roles[$id]; @@ -196,6 +196,7 @@ class roles { return $role; } } + return null; } /**