mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
notification fix
This commit is contained in:
@@ -30,7 +30,7 @@ class SendNotificationWhenPostIsLiked
|
|||||||
|
|
||||||
public function handle(PostWasLiked $event)
|
public function handle(PostWasLiked $event)
|
||||||
{
|
{
|
||||||
if ($event->post->user->id != $event->user->id) {
|
if ($event->post->user && $event->post->user->id != $event->user->id) {
|
||||||
$this->notifications->sync(
|
$this->notifications->sync(
|
||||||
new PostLikedBlueprint($event->post, $event->user),
|
new PostLikedBlueprint($event->post, $event->user),
|
||||||
[$event->post->user]
|
[$event->post->user]
|
||||||
|
@@ -30,7 +30,7 @@ class SendNotificationWhenPostIsUnliked
|
|||||||
|
|
||||||
public function handle(PostWasUnliked $event)
|
public function handle(PostWasUnliked $event)
|
||||||
{
|
{
|
||||||
if ($event->post->user->id != $event->user->id) {
|
if ($event->post->user && $event->post->user->id != $event->user->id) {
|
||||||
$this->notifications->sync(
|
$this->notifications->sync(
|
||||||
new PostLikedBlueprint($event->post, $event->user),
|
new PostLikedBlueprint($event->post, $event->user),
|
||||||
[]
|
[]
|
||||||
|
Reference in New Issue
Block a user