Skip to content

Commit

Permalink
Merge pull request #188 from fblaser/fix-empty-session-decrypt-exception
Browse files Browse the repository at this point in the history
Avoid calling decrypt when the session is null
  • Loading branch information
jeffgreco13 authored Aug 3, 2023
2 parents a69fc7e + f009563 commit b6bab03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Traits/TwoFactorAuthenticatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public function hasConfirmedTwoFactor(): bool
public function twoFactorRecoveryCodes(): Attribute
{
return Attribute::make(
get: fn () => json_decode(decrypt(
$this->breezySession?->two_factor_recovery_codes),true)
get: fn () => $this->breezySession ? json_decode(decrypt(
$this->breezySession->two_factor_recovery_codes),true) : null
);
}

Expand Down

0 comments on commit b6bab03

Please sign in to comment.