mirror of
https://github.com/flarum/framework.git
synced 2025-03-01 07:24:25 +08:00
Merge pull request #17 from the-turk/master
Fix notifications for [deleted] users
This commit is contained in:
commit
ea60da9ee5
@ -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),
|
||||||
[]
|
[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user