From b49dc3003684bdb1d3d0bf42b421d4e9c3ddffe7 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 8 Mar 2024 11:28:37 +0100 Subject: [PATCH] Delete moderation queue comment notifications if the moderation queue object has already been deleted. --- .../ModerationQueueCommentUserNotificationEvent.class.php | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- 2.20.1