Skip to content
Permalink
Browse files

Fixed crash with setAccountPassword

  • Loading branch information...
ccw808 committed Aug 7, 2018
1 parent 1321b53 commit faa57a7309989f16b070b4f84d7ecee4f6b2d9c3
Showing with 2 additions and 4 deletions.
  1. +2 −4 Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
@@ -11065,9 +11065,8 @@ bool CStaticFunctionDefinitions::RemoveAccount(CAccount* pAccount)
bool CStaticFunctionDefinitions::SetAccountName(CAccount* pAccount, SString strNewName, bool bAllowCaseVariations, SString& strOutError)
{
assert(pAccount);
assert(!strNewName.empty());

if (pAccount->IsRegistered())
if (!strNewName.empty() && pAccount->IsRegistered())
{
// Check for case variations if not allowed
if (!bAllowCaseVariations)
@@ -11100,9 +11099,8 @@ bool CStaticFunctionDefinitions::SetAccountName(CAccount* pAccount, SString strN
bool CStaticFunctionDefinitions::SetAccountPassword(CAccount* pAccount, SString strPassword, CAccountPassword::EAccountPasswordType ePasswordType)
{
assert(pAccount);
assert(!strPassword.empty());

if (pAccount->IsRegistered())
if (!strPassword.empty() && pAccount->IsRegistered())
{
if ((ePasswordType == CAccountPassword::PLAINTEXT && CAccountManager::IsValidNewPassword(strPassword)) ||
(ePasswordType == CAccountPassword::MD5 && strPassword.length() == 32) ||

1 comment on commit faa57a7

@patrikjuvonen

This comment has been minimized.

Copy link
Member

patrikjuvonen commented on faa57a7 Aug 7, 2018

Related issue: #306

Please sign in to comment.
You can’t perform that action at this time.