Fix the handling of users that do not exist anymore
authorAlexander Ebert <ebert@woltlab.com>
Thu, 15 Aug 2024 10:00:58 +0000 (12:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 15 Aug 2024 10:00:58 +0000 (12:00 +0200)
wcfsetup/install/files/lib/system/background/job/ServiceWorkerDeliveryBackgroundJob.class.php

index 8be21b399fee677d79d915604a5ea93afcfd5e10..3cdd7da3a3bfe7ab28db505779bee61cbaec7259 100644 (file)
@@ -58,6 +58,11 @@ final class ServiceWorkerDeliveryBackgroundJob extends AbstractUniqueBackgroundJ
     {
         $serviceWorker = new ServiceWorker($serviceWorkerID);
         $user = UserProfileRuntimeCache::getInstance()->getObject($serviceWorker->userID);
+        if ($user === null) {
+            // The user does not exist anymore.
+            return;
+        }
+
         $style = new Style($user->styleID);
         if (!$style->styleID) {
             $style = StyleHandler::getInstance()->getStyle();