Skip to content

Commit

Permalink
fix empty route
Browse files Browse the repository at this point in the history
  • Loading branch information
eeliu committed Sep 2, 2024
1 parent 876bb1c commit 329f7bf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/Pinpoint/Plugins/LaravelPerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,17 @@ class LaravelPerRequest extends DefaultRequestPlugin
{
public function __destruct()
{
pinpoint_set_context(PP_ROUTE_KEY, Request()->route()->uri());
$route = Request()->route();
if ($route) {
pinpoint_set_context(PP_ROUTE_KEY, Request()->route()->uri());
} else {
pinpoint_set_context(PP_ROUTE_KEY, "_none_");
}
parent::__destruct();
}
}
//author: eeliu
//author: eeliu

// Changes
// 2024/9/02
// fix "Request()->route()" can be none

0 comments on commit 329f7bf

Please sign in to comment.