3
0
mirror of https://github.com/snipe/snipe-it.git synced 2025-10-29 11:21:21 +00:00

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.
This commit is contained in:
Nathan Taylor 2025-05-06 09:47:33 +10:00
parent b37f488117
commit d4b73b4fb9

View File

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