Skip to content

Commit e974656

Browse files
committed
BUG: Some wrong Member checks in NotificationController
1 parent bc7578e commit e974656

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Controllers/NotificationsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function newComment(Comment $comment, $request)
175175
// All previous comments recipients
176176
foreach ($comm->notifications as $notification){
177177
$recipient = Member::find($notification->member_id);
178-
if (count($recipient) == 1 and ($comment->type == 'reply' or ($comment->type != 'reply' and $recipient->levelInCategory($ticket->category->id) > 1))
178+
if (!is_null($recipient) and ($comment->type == 'reply' or ($comment->type != 'reply' and $recipient->levelInCategory($ticket->category->id) > 1))
179179
and $notification_owner->id!= $recipient->id and !in_array($recipient->id, $a_recipients)){
180180

181181
$a_recipients[] = $recipient->id;
@@ -248,7 +248,7 @@ public function commentUpdate(Comment $original_comment, Comment $comment)
248248
// Send notification to all comment notified users
249249
foreach ($comment->notifications as $notification){
250250
$recipient = Member::find($notification->member_id);
251-
if (count($recipient) == 1){
251+
if (!is_null($recipient)){
252252
if ($recipient->email != $notification_owner->email){
253253
$a_to[] = [
254254
'recipient' => $recipient,

0 commit comments

Comments
 (0)