Skip to content

Commit 96be8e9

Browse files
RussellAultfguillot
authored andcommitted
Check for empty Groups Key
Right now if you don't set a Groups Key in the integration configuration then $this->getKey() will log "PHP Notice: Undefined index: " because it's being asked to look for a blank key. This commit first checks whether the key is set before passing it to getKey() to prevent this Notice.
1 parent dbf6658 commit 96be8e9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

User/GenericOAuth2UserProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ public function getEmail()
157157
*/
158158
public function getExternalGroupIds()
159159
{
160-
$groups = $this->getKey('oauth2_key_groups');
160+
$key = 'oauth2_key_groups';
161+
162+
if (empty($this->configModel->get($key))) {
163+
return array();
164+
}
165+
166+
$groups = $this->getKey($key);
161167

162168
if (empty($groups)) {
163169
$this->logger->debug('OAuth2: '.$this->getUsername().' has no groups');

0 commit comments

Comments
 (0)