fix(SessionBasketRepository): handle corrupted session payload correctly
Ensure that corrupted session data is ignored and null is returned, improving robustness.
This commit is contained in:
parent
f658dd4b64
commit
d45022d8a4
1 changed files with 3 additions and 2 deletions
|
|
@ -45,8 +45,9 @@ class SessionBasketRepository implements BasketRepository
|
|||
if (is_array($decoded)) {
|
||||
return $this->serializer->fromArray($decoded);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// Ignore and fall back to null
|
||||
} catch (\Throwable) {
|
||||
// Ignore corrupted session payload and fall back to null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue