From 085159e575534f58504415d4357ea7bc547094d7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 10 Oct 2023 19:13:19 -0600 Subject: [PATCH] Update NotificationService, handle empty epoch. Fixes #4689 --- app/Services/NotificationService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Services/NotificationService.php b/app/Services/NotificationService.php index c068f8278..d088c2015 100644 --- a/app/Services/NotificationService.php +++ b/app/Services/NotificationService.php @@ -49,6 +49,9 @@ class NotificationService { public static function getEpochId($months = 6) { return Cache::remember(self::EPOCH_CACHE_KEY . $months, 1209600, function() use($months) { + if(Notification::count() === 0) { + return 0; + } return Notification::where('created_at', '>', now()->subMonths($months))->first()->id; }); }