mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:38:08 +08:00
notification fix
This commit is contained in:
parent
ce79f60b4b
commit
08bcdbd8da
@ -30,7 +30,7 @@ class SendNotificationWhenPostIsLiked
|
||||
|
||||
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(
|
||||
new PostLikedBlueprint($event->post, $event->user),
|
||||
[$event->post->user]
|
||||
|
@ -30,7 +30,7 @@ class SendNotificationWhenPostIsUnliked
|
||||
|
||||
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(
|
||||
new PostLikedBlueprint($event->post, $event->user),
|
||||
[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user