Skip to content

Commit ba01be5

Browse files
authored
Merge pull request #29 from subit-io/master
bug fix
2 parents 28f2de3 + 6c26e3a commit ba01be5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/MessagebirdChannel.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ public function send($notifiable, Notification $notification)
4949
$this->dispatcher->dispatch('messagebird-sms', [$notifiable, $notification, $data]);
5050
}
5151
} catch (CouldNotSendNotification $e) {
52-
$this->dispatcher->dispatch(
53-
new NotificationFailed(
54-
$notifiable,
55-
$notification,
56-
'messagebird-sms',
57-
$e->getMessage()
58-
)
59-
);
52+
if ($this->dispatcher !== null) {
53+
$this->dispatcher->dispatch(
54+
new NotificationFailed(
55+
$notifiable,
56+
$notification,
57+
'messagebird-sms',
58+
$e->getMessage()
59+
)
60+
);
61+
}
6062
}
6163

6264
return $data;

0 commit comments

Comments
 (0)