Skip to content

Commit

Permalink
Fix null handling in LoginLinkRequest userAttributes
Browse files Browse the repository at this point in the history
Previously, the method could return `null` if `user_attributes` was not set. This update ensures it always returns an array, preventing potential issues with downstream usage.
  • Loading branch information
fouteox committed Dec 13, 2024
1 parent 072e307 commit 5425327
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Http/Requests/LoginLinkRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public function rules(): array

public function userAttributes(): array
{
return json_decode($this->user_attributes, true) ?? [];
if ($this->user_attributes !== null) {
return json_decode($this->user_attributes);
}

return [];
}
}

0 comments on commit 5425327

Please sign in to comment.