Fix undefined property check for user

This commit is contained in:
Ivan Diaz 2021-09-18 23:07:09 -03:00
parent fc93ad4c00
commit 064f00388a
No known key found for this signature in database
GPG Key ID: CB57E2CB1A6FDF44
1 changed files with 3 additions and 3 deletions

View File

@ -114,7 +114,7 @@ class CreateController extends Controller {
throw new Exception(ERRORS::INVALID_EMAIL); throw new Exception(ERRORS::INVALID_EMAIL);
} }
if(!Controller::isLoginMandatory() && !Controller::isStaffLogged() && !Controller::isUserLogged() && !User::getUser($this->email, 'email')->email){ if(!Controller::isLoginMandatory() && !Controller::isStaffLogged() && !Controller::isUserLogged() && User::getUser($this->email, 'email')->isNull()){
$this->createNewUser(); $this->createNewUser();
} }
@ -237,9 +237,9 @@ class CreateController extends Controller {
} }
private function getAuthor() { private function getAuthor() {
if(Controller::getLoggedUser()->email) { if (!Controller::getLoggedUser()->isNull()) {
return Controller::getLoggedUser(); return Controller::getLoggedUser();
}else{ } else {
return User::getUser($this->email, 'email'); return User::getUser($this->email, 'email');
} }
} }