Remove `null` values from the runtime cache
authorAlexander Ebert <ebert@woltlab.com>
Sun, 29 Dec 2024 16:08:18 +0000 (17:08 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 29 Dec 2024 16:08:18 +0000 (17:08 +0100)
See https://www.woltlab.com/community/thread/310416/

wcfsetup/install/files/lib/system/user/activity/event/TCommentResponseUserActivityEvent.class.php

index 0e1cd435ec1396723ec05607454be0ff7969f11c..ab980c506c99aa7bc9d370e8028585ccefe67561 100644 (file)
@@ -57,7 +57,7 @@ trait TCommentResponseUserActivityEvent
             $responseIDs[] = $event->objectID;
         }
 
-        $this->responses = ViewableCommentResponseRuntimeCache::getInstance()->getObjects($responseIDs);
+        $this->responses = \array_filter(ViewableCommentResponseRuntimeCache::getInstance()->getObjects($responseIDs));
 
         $commentIDs = [];
         foreach ($this->responses as $response) {
@@ -65,7 +65,7 @@ trait TCommentResponseUserActivityEvent
         }
 
         if (!empty($commentIDs)) {
-            $this->comments = ViewableCommentRuntimeCache::getInstance()->getObjects($commentIDs);
+            $this->comments = \array_filter(ViewableCommentRuntimeCache::getInstance()->getObjects($commentIDs));
         }
 
         $userIDs = [];
@@ -74,7 +74,7 @@ trait TCommentResponseUserActivityEvent
             $this->commentObjectIDs[] = $comment->objectID;
         }
         if (!empty($userIDs)) {
-            $this->commentAuthors = UserProfileRuntimeCache::getInstance()->getObjects($userIDs);
+            $this->commentAuthors = \array_filter(UserProfileRuntimeCache::getInstance()->getObjects($userIDs));
         }
     }
 }