Fix crash when using incorrectly formatted password hash

This commit is contained in:
Jean Flach 2017-12-22 12:58:39 +01:00
parent 6387f5442e
commit 2e5aedd28a
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
return nullptr;
else {
Dictionary::Ptr passwordDict = user->GetPasswordDict();
if (!ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
if (!passwordDict || !ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
return nullptr;
}