Skip to content

Commit

Permalink
Check that discussion/post still exists before attempting to notify (#16
Browse files Browse the repository at this point in the history
)

* Attempting to fix #13

* Ensure discussion still exists before attempting to send notification job

* Apply fixes from StyleCI
  • Loading branch information
imorland authored Dec 9, 2020
1 parent 661b2c6 commit ac0cfbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Jobs/SendNotificationWhenDiscussionIsReTagged.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function __construct(User $actor, Discussion $discussion)

public function handle(NotificationSyncer $notifications)
{
if (!$this->discussion->exists()) {
return;
}

/**
* @var Collection
Expand Down
3 changes: 3 additions & 0 deletions src/Jobs/SendNotificationWhenDiscussionIsStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function __construct(Discussion $discussion)

public function handle(NotificationSyncer $notifications)
{
if (!$this->discussion->exists()) {
return;
}

/**
* @var Collection
Expand Down
4 changes: 4 additions & 0 deletions src/Jobs/SendNotificationWhenReplyIsPosted.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public function __construct(Post $post, int $lastPostNumber)

public function handle(NotificationSyncer $notifications)
{
if (!$this->post->exists()) {
return;
}

/**
* @var Collection
* @var $tagIds Collection
Expand Down

0 comments on commit ac0cfbc

Please sign in to comment.