- Fixed a bug where given entity would failed it's loading with an error

This commit is contained in:
mcndave committed 2023-12-12 18:57:03 -05:00
1 parent 70daae93f5
commit 0657622eab
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -27,8 +27,13 @@ class Authenticate {
public function rememberMe() : ? UserInterface
{
$logUser = function(? int $id) {
if ( $id === null || null === ( $user = $this->user::repository()->loadFromPk($id) ) ) {
throw new \InvalidArgumentException(sprintf("User having id '%s' was not found.", $id));
try {
if ($id === null || null === ($user = $this->user::repository()->loadFromPk($id))) {
throw new \InvalidArgumentException(sprintf("User having id '%s' was not found.", $id));
}
}
catch(\Exception $ex) {
return null;
}
$this->user->fromArray($user);