Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: null notify

Andras Bacsai2dc175be6342
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 9e9725bd11..652fd22626 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -1341,10 +1341,10 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
}
queue_next_deployment($this->application);
if ($status === ApplicationDeploymentStatus::FINISHED->value) {
- $this->application->environment->project->team->notify(new DeploymentSuccess($this->application, $this->deployment_uuid, $this->preview));
+ $this->application->environment->project->team?->notify(new DeploymentSuccess($this->application, $this->deployment_uuid, $this->preview));
}
if ($status === ApplicationDeploymentStatus::FAILED->value) {
- $this->application->environment->project->team->notify(new DeploymentFailed($this->application, $this->deployment_uuid, $this->preview));
+ $this->application->environment->project->team?->notify(new DeploymentFailed($this->application, $this->deployment_uuid, $this->preview));
}
}
diff --git a/app/Jobs/CheckLogDrainContainerJob.php b/app/Jobs/CheckLogDrainContainerJob.php
index e66a0c08ae..eb677265b8 100644
--- a/app/Jobs/CheckLogDrainContainerJob.php
+++ b/app/Jobs/CheckLogDrainContainerJob.php
@@ -63,19 +63,19 @@ class CheckLogDrainContainerJob implements ShouldQueue, ShouldBeEncrypted
Sleep::for(10)->seconds();
if ($this->healthcheck()) {
if ($this->server->log_drain_notification_sent) {
- $this->server->team->notify(new ContainerRestarted('Coolify Log Drainer', $this->server));
+ $this->server->team?->notify(new ContainerRestarted('Coolify Log Drainer', $this->server));
$this->server->update(['log_drain_notification_sent' => false]);
}
return;
}
if (!$this->server->log_drain_notification_sent) {
ray('Log drain container still unhealthy. Sending notification...');
- $this->server->team->notify(new ContainerStopped('Coolify Log Drainer', $this->server, null));
+ $this->server->team?->notify(new ContainerStopped('Coolify Log Drainer', $this->server, null));
$this->server->update(['log_drain_notification_sent' => true]);
}
} else {
if ($this->server->log_drain_notification_sent) {
- $this->server->team->notify(new ContainerRestarted('Coolify Log Drainer', $this->server));
+ $this->server->team?->notify(new ContainerRestarted('Coolify Log Drainer', $this->server));
$this->server->update(['log_drain_notification_sent' => false]);
}
}
diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php
index 1ba855f4ee..8a854128a5 100644
--- a/app/Jobs/DatabaseBackupJob.php
+++ b/app/Jobs/DatabaseBackupJob.php
@@ -286,7 +286,7 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted
if ($this->backup->save_s3) {
$this->upload_to_s3();
}
- $this->team->notify(new BackupSuccess($this->backup, $this->database));
+ $this->team?->notify(new BackupSuccess($this->backup, $this->database));
$this->backup_log->update([
'status' => 'success',
'message' => $this->backup_output,
@@ -302,7 +302,7 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted
]);
}
send_internal_notification('DatabaseBackupJob failed with: ' . $e->getMessage());
- $this->team->notify(new BackupFailed($this->backup, $this->database, $this->backup_output));
+ $this->team?->notify(new BackupFailed($this->backup, $this->database, $this->backup_output));
throw $e;
}
}
diff --git a/app/Jobs/ServerStatusJob.php b/app/Jobs/ServerStatusJob.php
index cfe61598f6..9dacea95c2 100644
--- a/app/Jobs/ServerStatusJob.php
+++ b/app/Jobs/ServerStatusJob.php
@@ -54,7 +54,7 @@ class ServerStatusJob implements ShouldQueue, ShouldBeEncrypted
} else {
$this->server->high_disk_usage_notification_sent = true;
$this->server->save();
- $this->server->team->notify(new HighDiskUsage($this->server, $this->disk_usage, $this->server->settings->cleanup_after_percentage));
+ $this->server->team?->notify(new HighDiskUsage($this->server, $this->disk_usage, $this->server->settings->cleanup_after_percentage));
}
} else {
DockerCleanupJob::dispatchSync($this->server);
diff --git a/app/Livewire/Notifications/DiscordSettings.php b/app/Livewire/Notifications/DiscordSettings.php
index cf8b116d40..f5f0d5591e 100644
--- a/app/Livewire/Notifications/DiscordSettings.php
+++ b/app/Livewire/Notifications/DiscordSettings.php
@@ -52,7 +52,7 @@ class DiscordSettings extends Component
public function sendTestNotification()
{
- $this->team->notify(new Test());
+ $this->team?->notify(new Test());
$this->dispatch('success', 'Test notification sent.');
}
}
diff --git a/app/Livewire/Notifications/EmailSettings.php b/app/Livewire/Notifications/EmailSettings.php
index f3b1218510..cdbaef051d 100644
--- a/app/Livewire/Notifications/EmailSettings.php
+++ b/app/Livewire/Notifications/EmailSettings.php
@@ -70,7 +70,7 @@ class EmailSettings extends Component
}
public function sendTestNotification()
{
- $this->team->notify(new Test($this->emails));
+ $this->team?->notify(new Test($this->emails));
$this->dispatch('success', 'Test Email sent successfully.');
}
public function instantSaveInstance()
diff --git a/app/Livewire/Notifications/TelegramSettings.php b/app/Livewire/Notifications/TelegramSettings.php
index 08f1be0056..0f581a5151 100644
--- a/app/Livewire/Notifications/TelegramSettings.php
+++ b/app/Livewire/Notifications/TelegramSettings.php
@@ -58,7 +58,7 @@ class TelegramSettings extends Component
public function sendTestNotification()
{
- $this->team->notify(new Test());
+ $this->team?->notify(new Test());
$this->dispatch('success', 'Test notification sent.');
}
}
diff --git a/app/Livewire/Settings/Email.php b/app/Livewire/Settings/Email.php
index d005462a81..471c18e9c7 100644
--- a/app/Livewire/Settings/Email.php
+++ b/app/Livewire/Settings/Email.php
@@ -106,7 +106,7 @@ class Email extends Component
public function sendTestNotification()
{
- $this->settings->notify(new Test($this->emails));
+ $this->settings?->notify(new Test($this->emails));
$this->dispatch('success', 'Test email sent.');
}
}
diff --git a/app/Models/Server.php b/app/Models/Server.php
index 37a5ffe2ae..790b300259 100644
--- a/app/Models/Server.php
+++ b/app/Models/Server.php
@@ -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]);
}
diff --git a/app/Models/User.php b/app/Models/User.php
index ee963a5238..c099eb2b6c 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -98,7 +98,7 @@ class User extends Authenticatable implements SendsEmail
}
public function sendPasswordResetNotification($token): void
{
- $this->notify(new TransactionalEmailsResetPassword($token));
+ $this?->notify(new TransactionalEmailsResetPassword($token));
}
public function isAdmin()