Fix issue with caches and deleted users in UserListBoxController
authorMatthias Schmidt <gravatronics@live.com>
Sun, 21 Aug 2016 05:44:32 +0000 (07:44 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 21 Aug 2016 05:44:32 +0000 (07:44 +0200)
wcfsetup/install/files/lib/system/box/UserListBoxController.class.php

index bc81384a36c2caa3f76244d773d75e6a0d037e36..fe07ef3ea1d248432d2b24860ab7499f54464d3b 100644 (file)
@@ -104,6 +104,11 @@ class UserListBoxController extends AbstractDatabaseObjectListBoxController {
                if ($this->userIDs !== null) {
                        $userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($this->userIDs);
                        
+                       // filter `null` values of users that have been deleted in the meantime
+                       $userProfiles = array_filter($userProfiles, function($userProfile) {
+                               return $userProfile !== null;
+                       });
+                       
                        DatabaseObject::sort($userProfiles, $this->sortField, $this->sortOrder);
                }