Move check to top of function
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 2 Feb 2024 10:37:28 +0000 (11:37 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 2 Feb 2024 10:37:28 +0000 (11:37 +0100)
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index 9c082239413cf1255c656203168c3d447bbd4b29..6d90f2480e965290d6c0954188afdc33f8cde182 100644 (file)
@@ -105,6 +105,9 @@ class UserNotificationHandler extends SingletonFactory
         if (!isset($this->availableEvents[$objectType][$eventName])) {
             throw new SystemException("Unknown event " . $objectType . "-" . $eventName . " given");
         }
+        if ($recipientIDs === []) {
+            return;
+        }
 
         // get objects
         $objectTypeObject = $this->availableObjectTypes[$objectType];
@@ -141,9 +144,6 @@ class UserNotificationHandler extends SingletonFactory
         // @deprecated 5.2 This event exposes incomplete data and should not
         // be used, please use the following events instead.
         EventHandler::getInstance()->fireAction($this, 'fireEvent', $parameters);
-        if ($recipientIDs === []) {
-            return;
-        }
 
         // find existing notifications
         $conditions = new PreparedStatementConditionBuilder();