fix: null notify

This commit is contained in:
Andras Bacsai
2023-12-13 12:01:27 +01:00
parent d93bf97919
commit 2dc175be63
10 changed files with 15 additions and 15 deletions

View File

@@ -164,7 +164,7 @@ class Server extends BaseModel
if ($serverUptimeCheckNumber >= $serverUptimeCheckNumberMax) {
if ($this->unreachable_notification_sent === false) {
ray('Server unreachable, sending notification...');
$this->team->notify(new Unreachable($this));
$this->team?->notify(new Unreachable($this));
$this->update(['unreachable_notification_sent' => true]);
}
$this->settings()->update([
@@ -401,7 +401,7 @@ class Server extends BaseModel
}
if (data_get($server, 'unreachable_notification_sent') === true) {
$server->team->notify(new Revived($server));
$server->team?->notify(new Revived($server));
$server->update(['unreachable_notification_sent' => false]);
}