Skip to content

Commit 55f17d5

Browse files
authored
Fix: Call to a member function getName() on null
This fix the `Call to a member function getName() on null` error when trying to access the supposedly`NotFoundHttpException` routes.
1 parent ee20c77 commit 55f17d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/RequestLog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function log(Request $request, $response, ?int $duration = null, ?int $me
102102
$model->session = $request->hasSession() ? $request->session()->getId() : null;
103103
$model->middleware = array_values(optional($request->route())->gatherMiddleware() ?? []);
104104
$model->method = $request->getMethod();
105-
$model->route = $request->route()->getName();
105+
$model->route = $request->route()?->getName();
106106
$model->path = $request->path();
107107
$model->status = $response->getStatusCode();
108108
$model->headers = $this->getFiltered($request->headers->all()) ?: null;

0 commit comments

Comments
 (0)