Fix: Setup-Route und Wizard gegen fehlende DB absichern (try/catch)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
boban 2026-04-23 22:03:30 +02:00
parent 94cddb7987
commit 8551a00414
2 changed files with 15 additions and 7 deletions

View File

@ -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); }

View File

@ -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');
}