Skip to content

Commit

Permalink
#10402 Do not attempt to notify disabled users
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Sep 12, 2024
1 parent f2f64dd commit d2f7fa5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controllers/grid/queries/QueryNotesGridHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ protected function insertedNoteNotify(Note $note): void
if ($userId == $sender->getId()) {
continue;
}
$recipient = Repo::user()->get($userId);
// Do not attempt to notify disabled users. (pkp/pkp-lib#10402)
if (!$recipient) {
continue;
}

// Notify the user of a new query.
$notification = $notificationManager->createNotification(
Expand All @@ -330,12 +335,10 @@ protected function insertedNoteNotify(Note $note): void
$userId,
(int) $context->getId()
)
)
) {
)) {
continue;
}

$recipient = Repo::user()->get($userId);
$mailable = $this->getStageMailable($context, $submission)
->sender($sender)
->recipients([$recipient])
Expand Down

0 comments on commit d2f7fa5

Please sign in to comment.