Avoid trying to get property of non-object

This commit is contained in:
Bartek Fabiszewski 2020-05-21 15:51:31 +02:00
parent d1765af0c5
commit 0e79e907b5

View File

@ -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"]);
}