From a332e0d7b15a05d7a611624ef59c0604e74b5ae4 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 22 Nov 2013 09:53:27 -0600 Subject: [PATCH] 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. --- gui/MainWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)