From bb451ac3b5c89dceaafe95a0d2e4cfd002f3f366 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 17 May 2024 13:43:36 +0200 Subject: [PATCH] Refactor BackupExecutions.php to use optional chaining for deleting failed backup executions --- app/Livewire/Project/Database/BackupExecutions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/Project/Database/BackupExecutions.php b/app/Livewire/Project/Database/BackupExecutions.php index a34d849f2..101bb4593 100644 --- a/app/Livewire/Project/Database/BackupExecutions.php +++ b/app/Livewire/Project/Database/BackupExecutions.php @@ -20,7 +20,7 @@ class BackupExecutions extends Component public function cleanupFailed() { - $this->backup->executions()->where('status', 'failed')->delete(); + $this->backup?->executions()->where('status', 'failed')->delete(); $this->refreshBackupExecutions(); } public function deleteBackup($exeuctionId)