Skip to content

Commit cb14304

Browse files
jthomaschewskistayallive
authored andcommitted
Check if user context is array (fix fatal error) (#272)
* Check if user context is array Prevents potential fatal error as the argument for Scope::setUser must be of type array * Make sure user is always an array If user array is invalid, Sentry will display a warning. This ensures the context is not silently ignored. Co-Authored-By: Alex Bouma <[email protected]> * Fix formatting
1 parent dc21a67 commit cb14304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Sentry/Laravel/SentryHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function (Scope $scope) use ($record) {
175175
}
176176

177177
if (!empty($record['context']['user'])) {
178-
$scope->setUser($record['context']['user']);
178+
$scope->setUser((array)$record['context']['user']);
179179
unset($record['context']['user']);
180180
}
181181

0 commit comments

Comments
 (0)