diff --git a/extensions/likes/src/Listener/SendNotificationWhenPostIsLiked.php b/extensions/likes/src/Listener/SendNotificationWhenPostIsLiked.php index 401394048d..0d148586c8 100755 --- a/extensions/likes/src/Listener/SendNotificationWhenPostIsLiked.php +++ b/extensions/likes/src/Listener/SendNotificationWhenPostIsLiked.php @@ -22,7 +22,7 @@ public function __construct( public function handle(PostWasLiked $event): void { - if ($event->post->user && $event->post->user->id != $event->user->id) { + if (gettype($event->post->content) == "string" && $event->post->user && $event->post->user->id != $event->user->id) { $this->notifications->sync( new PostLikedBlueprint($event->post, $event->user), [$event->post->user] diff --git a/extensions/likes/src/Listener/SendNotificationWhenPostIsUnliked.php b/extensions/likes/src/Listener/SendNotificationWhenPostIsUnliked.php index 5a9b97733b..f590f8317b 100755 --- a/extensions/likes/src/Listener/SendNotificationWhenPostIsUnliked.php +++ b/extensions/likes/src/Listener/SendNotificationWhenPostIsUnliked.php @@ -22,7 +22,7 @@ public function __construct( public function handle(PostWasUnliked $event): void { - if ($event->post->user && $event->post->user->id != $event->user->id) { + if (gettype($event->post->content) == "string" && $event->post->user && $event->post->user->id != $event->user->id) { $this->notifications->sync( new PostLikedBlueprint($event->post, $event->user), []