Skip to content

Commit f4ce2ef

Browse files
committed
fix warning Undefined array key "groups"
Signed-off-by: Naoto Kobayashi <[email protected]>
1 parent c7829fa commit f4ce2ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

action.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public function getUser()
4343
$data['user'] = $result['preferred_username'];
4444
$data['name'] = $result['name'];
4545
$data['mail'] = $result['email'];
46-
$data['grps'] = $result['groups'];
46+
if (array_key_exists('groups', $result)) {
47+
$data['grps'] = $result['groups'];
48+
} else {
49+
$data['grps'] = [];
50+
}
4751

4852
return $data;
4953
}

0 commit comments

Comments
 (0)