diff --git a/app/Exceptions/Trackers/Bugsnag.php b/app/Exceptions/Trackers/Bugsnag.php index 3bdacca86..818c39ec2 100644 --- a/app/Exceptions/Trackers/Bugsnag.php +++ b/app/Exceptions/Trackers/Bugsnag.php @@ -24,6 +24,6 @@ class Bugsnag public static function getRouteName(): ?string { - return request()->route()->getName(); + return request()->route()?->getName(); } } diff --git a/app/Exceptions/Trackers/Sentry.php b/app/Exceptions/Trackers/Sentry.php index c67a399a3..8bad77c3b 100644 --- a/app/Exceptions/Trackers/Sentry.php +++ b/app/Exceptions/Trackers/Sentry.php @@ -71,6 +71,6 @@ class Sentry public static function getRouteName(): ?string { - return request()->route()->getName(); + return request()->route()?->getName(); } }