From d4b73b4fb984f256de882374d09c322ff45aae99 Mon Sep 17 00:00:00 2001 From: Nathan Taylor Date: Tue, 6 May 2025 09:47:33 +1000 Subject: [PATCH] Avoids potential error when alerts table is empty Updates the Kernel to use the null-safe operator when accessing the alerts_enabled setting. This prevents a potential error if the settings object is null. --- app/Console/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 664c8edc62..ca85459b67 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - if(Setting::getSettings()->alerts_enabled === 1) { + if(Setting::getSettings()?->alerts_enabled === 1) { $schedule->command('snipeit:inventory-alerts')->daily(); $schedule->command('snipeit:expiring-alerts')->daily(); $schedule->command('snipeit:expected-checkin')->daily();