summaryrefslogtreecommitdiffstats
path: root/logic/lists/MojangAccountList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/lists/MojangAccountList.cpp')
-rw-r--r--logic/lists/MojangAccountList.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/logic/lists/MojangAccountList.cpp b/logic/lists/MojangAccountList.cpp
index 1d67c70f..a30ef4ab 100644
--- a/logic/lists/MojangAccountList.cpp
+++ b/logic/lists/MojangAccountList.cpp
@@ -93,9 +93,16 @@ MojangAccountPtr MojangAccountList::activeAccount() const
void MojangAccountList::setActiveAccount(const QString& username)
{
beginResetModel();
- for (MojangAccountPtr account : m_accounts)
- if (account->username() == username)
- m_activeAccount = username;
+ if (username.isEmpty())
+ {
+ m_activeAccount = "";
+ }
+ else
+ {
+ for (MojangAccountPtr account : m_accounts)
+ if (account->username() == username)
+ m_activeAccount = username;
+ }
endResetModel();
onListChanged();
}