Skip to content

Commit

Permalink
Delete moderation queue comment notifications if the moderation queue…
Browse files Browse the repository at this point in the history
… object has already been deleted.
  • Loading branch information
Cyperghost committed Mar 8, 2024
1 parent 9cb9a1a commit b49dc30
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function checkAccess()
if (!WCF::getSession()->getPermission('mod.general.canUseModeration')) {
return false;
}
if (!$this->moderationQueue->queueID) {
return false;
}

return $this->moderationQueue->canEdit();
}
Expand Down Expand Up @@ -143,6 +146,9 @@ public function setObject(
$this->moderationQueue = new ViewableModerationQueue(
new ModerationQueue($this->getUserNotificationObject()->objectID)
);
if (!$this->moderationQueue->queueID) {
return;
}

/** @var IModerationQueueHandler $moderationHandler */
$moderationHandler = ObjectTypeCache::getInstance()
Expand Down

0 comments on commit b49dc30

Please sign in to comment.