From 064f00388a4f45b6aaf518c9fa1a726014dcadf9 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Sat, 18 Sep 2021 23:07:09 -0300 Subject: [PATCH] Fix undefined property check for user --- server/controllers/ticket/create.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/controllers/ticket/create.php b/server/controllers/ticket/create.php index 108c2744..b1df7bef 100755 --- a/server/controllers/ticket/create.php +++ b/server/controllers/ticket/create.php @@ -114,7 +114,7 @@ class CreateController extends Controller { 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(); } @@ -237,9 +237,9 @@ class CreateController extends Controller { } private function getAuthor() { - if(Controller::getLoggedUser()->email) { + if (!Controller::getLoggedUser()->isNull()) { return Controller::getLoggedUser(); - }else{ + } else { return User::getUser($this->email, 'email'); } }