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:
Jérémy Munsch 2026-11-16 11:40:24 +01:00
parent f658dd4b64
commit d45022d8a4
No known key found for this signature in database
GPG key ID: 2AAECDA6B7330F91

View file

@ -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;
}
}
}