diff --git a/src/Concerns/TracesHttpRequests.php b/src/Concerns/TracesHttpRequests.php index fe38437..237c9ee 100644 --- a/src/Concerns/TracesHttpRequests.php +++ b/src/Concerns/TracesHttpRequests.php @@ -148,7 +148,7 @@ private function calculateSpanName(Request $request): string // includes the name of the route, if it has one. $routeName = $route->getName(); - if (Str::startsWith($routeName, 'generated::')) { + if (($routeName !== null) && Str::startsWith($routeName, 'generated::')) { // This is a route name generated by for a closure when caching // routes. We don't want to include these in the trace, so we'll // just set the name to null and default to the route path.