Fix undefined property check for user
This commit is contained in:
parent
fc93ad4c00
commit
064f00388a
|
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue