notification fix

This commit is contained in:
the-turk 2020-02-26 20:13:12 +03:00
parent ce79f60b4b
commit 08bcdbd8da
2 changed files with 2 additions and 2 deletions

View File

@ -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]

View File

@ -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),
[]