Skip to content

Commit 619b5ee

Browse files
committed
Check if there is a current route defined before getting the action
This fixes an issue I discovered when a Laravel before filter returns a response.
1 parent 65f03be commit 619b5ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Intouch/LaravelNewrelic/LaravelNewrelicServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function getTransactionName( $request, $response, $app )
107107
$router = $app['router'];
108108

109109
$name = $router->currentRouteName()
110-
?: $router->currentRouteAction()
110+
?: $router->current() && $router->currentRouteAction()
111111
?: $request->getMethod() . ' ' . $request->getPathInfo();
112112
}
113113

0 commit comments

Comments
 (0)