From 8551a00414e2a9e971f90d224112a14bb053825e Mon Sep 17 00:00:00 2001 From: boban Date: Thu, 23 Apr 2026 22:03:30 +0200 Subject: [PATCH] Fix: Setup-Route und Wizard gegen fehlende DB absichern (try/catch) Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Setup/Wizard.php | 16 ++++++++++------ routes/web.php | 6 +++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/Livewire/Setup/Wizard.php b/app/Livewire/Setup/Wizard.php index 8c83a82..345d71e 100644 --- a/app/Livewire/Setup/Wizard.php +++ b/app/Livewire/Setup/Wizard.php @@ -47,12 +47,16 @@ class Wizard extends Component public function mount(): void { - $this->instance_name = config('app.name', 'Mailwolt'); - $this->timezone = Setting::get('timezone', 'Europe/Berlin'); - $this->locale = Setting::get('locale', 'de'); - $this->ui_domain = Setting::get('ui_domain', ''); - $this->mail_domain = Setting::get('mail_domain', ''); - $this->webmail_domain = Setting::get('webmail_domain', ''); + $this->instance_name = config('app.name', 'Mailwolt'); + try { + $this->timezone = Setting::get('timezone', 'Europe/Berlin'); + $this->locale = Setting::get('locale', 'de'); + $this->ui_domain = Setting::get('ui_domain', ''); + $this->mail_domain = Setting::get('mail_domain', ''); + $this->webmail_domain = Setting::get('webmail_domain', ''); + } catch (\Throwable) { + // DB noch nicht migriert — Standardwerte bleiben + } } public function updatedUiDomain(): void { $this->fillEmptyDomains($this->ui_domain); } diff --git a/routes/web.php b/routes/web.php index 255acef..85cf22b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,7 +13,11 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; Route::get('/', function () { - $setupDone = \App\Models\Setting::get('setup_completed', '0') === '1'; + try { + $setupDone = \App\Models\Setting::get('setup_completed', '0') === '1'; + } catch (\Throwable) { + $setupDone = false; + } if (!$setupDone) { return redirect()->route('setup'); }