Skip to content

Commit

Permalink
Check for empty request before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
bobvandevijver authored and bobdenotter committed Oct 14, 2022
1 parent 2779fdb commit 25171b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Widget/Injector/RequestZone.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public static function is(Request $request, string $value): bool
*/
public static function getFromRequest(?Request $request): string
{
if (!$request) {
return static::NOWHERE;
}

return $request->attributes->get(static::KEY) ?: static::NOWHERE;
}

Expand Down

0 comments on commit 25171b2

Please sign in to comment.