Browse Source

Update User manager

Visman 3 years ago
parent
commit
420a2e6f18
1 changed files with 10 additions and 2 deletions
  1. 10 2
      app/Models/User/Users.php

+ 10 - 2
app/Models/User/Users.php

@@ -105,7 +105,11 @@ class Users extends Manager
      */
      */
     public function loadByName(string $name, bool $caseInsencytive = false): ?User
     public function loadByName(string $name, bool $caseInsencytive = false): ?User
     {
     {
-        return $this->returnUser($this->Load->loadByName($name, $caseInsencytive));
+        if ('' === $name) {
+            return null;
+        } else {
+            return $this->returnUser($this->Load->loadByName($name, $caseInsencytive));
+        }
     }
     }
 
 
     /**
     /**
@@ -113,7 +117,11 @@ class Users extends Manager
      */
      */
     public function loadByEmail(string $email): ?User
     public function loadByEmail(string $email): ?User
     {
     {
-        return $this->returnUser($this->Load->loadByEmail($email));
+        if ('' === $email) {
+            return null;
+        } else {
+            return $this->returnUser($this->Load->loadByEmail($email));
+        }
     }
     }
 
 
     /**
     /**