Skip to content

Commit d4b73b4

Browse files
committed
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.
1 parent b37f488 commit d4b73b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Console/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel
1919
*/
2020
protected function schedule(Schedule $schedule)
2121
{
22-
if(Setting::getSettings()->alerts_enabled === 1) {
22+
if(Setting::getSettings()?->alerts_enabled === 1) {
2323
$schedule->command('snipeit:inventory-alerts')->daily();
2424
$schedule->command('snipeit:expiring-alerts')->daily();
2525
$schedule->command('snipeit:expected-checkin')->daily();

0 commit comments

Comments
 (0)