If no style selected use default style
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 19 Feb 2024 14:26:55 +0000 (15:26 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 23 Feb 2024 13:42:36 +0000 (14:42 +0100)
wcfsetup/install/files/lib/system/background/job/ServiceWorkerDeliveryBackgroundJob.class.php

index 4f8bfcddbf4d604cbb2f7b2761fcf53c54977e88..b1db3c4119df6df0ad035aee7c26da781ffc7dff 100644 (file)
@@ -11,6 +11,7 @@ use wcf\data\user\User;
 use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\service\worker\ServiceWorkerHandler;
 use wcf\system\session\SessionHandler;
+use wcf\system\style\StyleHandler;
 use wcf\system\user\notification\UserNotificationHandler;
 use wcf\system\WCF;
 use wcf\util\JSON;
@@ -42,6 +43,10 @@ final class ServiceWorkerDeliveryBackgroundJob extends AbstractBackgroundJob
         }
         $user = UserProfileRuntimeCache::getInstance()->getObject($serviceWorker->userID);
         $style = new Style($user->styleID);
+        if (!$style->styleID) {
+            $style = StyleHandler::getInstance()->getDefaultStyle();
+        }
+
         /** @see NotificationEmailDeliveryBackgroundJob::perform() */
         $sql = "SELECT      notification.*, notification_event.eventID, object_type.objectType
                 FROM        wcf1_user_notification notification