diff options
author | Andrew <forkk@forkk.net> | 2013-11-22 09:53:27 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-11-22 09:53:27 -0600 |
commit | a332e0d7b15a05d7a611624ef59c0604e74b5ae4 (patch) | |
tree | 05432b4ba37a59a1e6c504592de5c90494e28770 | |
parent | abf8408911c057d8aafe90790f5d2f5de0e1d97c (diff) | |
download | MultiMC-a332e0d7b15a05d7a611624ef59c0604e74b5ae4.tar MultiMC-a332e0d7b15a05d7a611624ef59c0604e74b5ae4.tar.gz MultiMC-a332e0d7b15a05d7a611624ef59c0604e74b5ae4.tar.lz MultiMC-a332e0d7b15a05d7a611624ef59c0604e74b5ae4.tar.xz MultiMC-a332e0d7b15a05d7a611624ef59c0604e74b5ae4.zip |
Fix crashing when there are no accounts added
The warning message actually displays now when there are no Mojang
accounts to log in with, rather than simply crashing MultiMC.
-rw-r--r-- | gui/MainWindow.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 734ed3b4..3279661f 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -569,7 +569,8 @@ void MainWindow::doLogin(const QString &errorMsg) // Tell the user they need to log in at least one account in order to play. CustomMessageBox::selectable(this, tr("No Accounts"), tr("In order to play Minecraft, you must have at least one Mojang or Minecraft account logged in to MultiMC. Please add an account."), - QMessageBox::Warning)->show(); + QMessageBox::Information)->exec(); + return; } else { @@ -612,6 +613,7 @@ void MainWindow::doLogin(const QString &errorMsg) void MainWindow::launchInstance(BaseInstance *instance, MojangAccountPtr account) { Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL"); + Q_ASSERT_X(account.get() != nullptr, "launchInstance", "account is NULL"); proc = instance->prepareForLaunch(account); if (!proc) |