diff options
Diffstat (limited to 'src/account-server/storage.cpp')
-rw-r--r-- | src/account-server/storage.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index a1270dca..38c37935 100644 --- a/src/account-server/storage.cpp +++ b/src/account-server/storage.cpp @@ -610,6 +610,9 @@ bool Storage::doesUserNameExist(const std::string &name) bool Storage::doesEmailAddressExist(const std::string &email) { + if (email.empty()) + return false; + try { std::ostringstream sql; @@ -910,7 +913,8 @@ void Storage::addAccount(Account &account) { mDb->bindValue(1, account.getName()); mDb->bindValue(2, account.getPassword()); - mDb->bindValue(3, account.getEmail()); + if (!account.getEmail().empty()) + mDb->bindValue(3, account.getEmail()); mDb->processSql(); account.setID(mDb->getLastId()); @@ -948,7 +952,8 @@ void Storage::flush(Account &account) { mDb->bindValue(1, account.getName()); mDb->bindValue(2, account.getPassword()); - mDb->bindValue(3, account.getEmail()); + if (!account.getEmail().empty()) + mDb->bindValue(3, account.getEmail()); mDb->bindValue(4, account.getLevel()); mDb->bindValue(5, account.getLastLogin()); mDb->bindValue(6, account.getID()); |