From: Cyperghost Date: Fri, 8 Mar 2024 10:28:37 +0000 (+0100) Subject: Delete moderation queue comment notifications if the moderation queue object has... X-Git-Tag: 6.0.11_dev_1~17^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b49dc3003684bdb1d3d0bf42b421d4e9c3ddffe7;p=GitHub%2FWoltLab%2FWCF.git Delete moderation queue comment notifications if the moderation queue object has already been deleted. --- diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php index d207b4f45b..41cf6597a0 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php @@ -55,6 +55,9 @@ class ModerationQueueCommentUserNotificationEvent extends AbstractCommentUserNot if (!WCF::getSession()->getPermission('mod.general.canUseModeration')) { return false; } + if (!$this->moderationQueue->queueID) { + return false; + } return $this->moderationQueue->canEdit(); } @@ -143,6 +146,9 @@ class ModerationQueueCommentUserNotificationEvent extends AbstractCommentUserNot $this->moderationQueue = new ViewableModerationQueue( new ModerationQueue($this->getUserNotificationObject()->objectID) ); + if (!$this->moderationQueue->queueID) { + return; + } /** @var IModerationQueueHandler $moderationHandler */ $moderationHandler = ObjectTypeCache::getInstance()