From b0b7842f9cc691d563113f831c2e773948cfb285 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 17 May 2024 13:43:21 +0200 Subject: [PATCH 1/2] Refactor BackupEdit component to handle null s3_storage_id --- app/Livewire/Project/Database/BackupEdit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/Project/Database/BackupEdit.php b/app/Livewire/Project/Database/BackupEdit.php index f5f476257..d7f7f5503 100644 --- a/app/Livewire/Project/Database/BackupEdit.php +++ b/app/Livewire/Project/Database/BackupEdit.php @@ -35,7 +35,7 @@ class BackupEdit extends Component public function mount() { $this->parameters = get_route_parameters(); - if (is_null($this->backup->s3_storage_id)) { + if (is_null(data_get($this->backup, 's3_storage_id'))) { $this->backup->s3_storage_id = 'default'; } } From bb451ac3b5c89dceaafe95a0d2e4cfd002f3f366 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 17 May 2024 13:43:36 +0200 Subject: [PATCH 2/2] 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)