Null pointer in the Editorial Reminder if the user has blocked notifications #10496
Labels
Bug:1:Low
A bug that does not have a severe consequence or affects a small number of users.
Milestone
Describe the bug
We see several errors in the OJS logs about a null pointer in EditorialReminder.php, and it's due to the $notification being null. In the handle() method below the $notification variable returned from
$notificationManager->createNotification()
could potentially be null. So when it's used in theallowUnsubscribe()
method of$mailable
it throws a null pointer error.pkp-lib/jobs/email/EditorialReminder.php
Lines 143 to 162 in 09388ce
This happens when the user has blocked notifications. In the
createNotification()
method ofPKPNotificationOperationManager
there's a check at the beginning to see if the user exists and has blocked notifications, in which casenull
is returned.pkp-lib/classes/notification/PKPNotificationOperationManager.php
Lines 143 to 167 in 09388ce
I don't understand the code well enough to say if the fix should be a null check on
$notification
after it gets created inEditorialReminder.php
, and if so then return fromhandle()
. Or if$mailable
should still be called without theallowUnsubscribe($notification)
method.What application are you using?
OJS 3.4.0-5
The text was updated successfully, but these errors were encountered: