Skip to content

Commit d76251a

Browse files
committed
handle null edge case
1 parent 8491519 commit d76251a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: resources/lib/UnityGroup.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function exists($ignorecache = false)
6666
{
6767
if (!$ignorecache) {
6868
$cached_pi_groups = $this->REDIS->getCache("sorted_pi_groups", "");
69-
return in_array($this->getPIUID(), $cached_pi_groups);
69+
if (!is_null($cached_pi_groups)) {
70+
return in_array($this->getPIUID(), $cached_pi_groups);
71+
}
7072
}
7173
return $this->getLDAPPiGroup()->exists();
7274
}

Diff for: resources/lib/UnityUser.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ public function getLDAPGroup()
157157
public function exists($ignorecache = false)
158158
{
159159
if (!$ignorecache) {
160-
$cached_val = $this->REDIS->getCache($this->uid, "cn");
161-
if (!is_null($cached_val)) {
162-
return true;
160+
$cached_users = $this->REDIS->getCache("sorted_users", "");
161+
if (!is_null($cached_users)) {
162+
return in_array($this->getPIUID(), $cached_users);
163163
}
164164
}
165165
return $this->getLDAPUser()->exists() && $this->getLDAPGroup()->exists();

0 commit comments

Comments
 (0)