summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-11-22 09:53:27 -0600
committerAndrew <forkk@forkk.net>2013-11-22 09:53:27 -0600
commita332e0d7b15a05d7a611624ef59c0604e74b5ae4 (patch)
tree05432b4ba37a59a1e6c504592de5c90494e28770 /gui
parentabf8408911c057d8aafe90790f5d2f5de0e1d97c (diff)
downloadMultiMC-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.
Diffstat (limited to 'gui')
-rw-r--r--gui/MainWindow.cpp4
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)