Fix "Trying to get property of non-object" errors when a user tries to log in using an unknown nickname

This commit is contained in:
Jeffery To 2009-06-12 19:58:30 +08:00
parent cfea2b0c4e
commit e2b20bd1e6

View File

@ -114,7 +114,7 @@ function common_check_user($nickname, $password)
return false;
}
$user = User::staticGet('nickname', $nickname);
if (is_null($user)) {
if (is_null($user) || $user === false) {
return false;
} else {
if (0 == strcmp(common_munge_password($password, $user->id),