From 0e79e907b5e3c34e2d86c3ea4fb63b0e402354cc Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Thu, 21 May 2020 15:51:31 +0200 Subject: [PATCH] Avoid trying to get property of non-object --- utils/handleuser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/handleuser.php b/utils/handleuser.php index b6fd871..1c8c06e 100644 --- a/utils/handleuser.php +++ b/utils/handleuser.php @@ -32,7 +32,7 @@ $admin = uUtils::postBool('admin', false); $lang = (new uLang($config))->getStrings(); -if ($auth->user->login === $login || empty($action) || empty($login) || !$auth->isAuthenticated() || !$auth->isAdmin()) { +if (($auth->user && $auth->user->login === $login) || empty($action) || empty($login) || !$auth->isAuthenticated() || !$auth->isAdmin()) { uUtils::exitWithError($lang["servererror"]); }