summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-12-07 01:19:03 +0100
committerPetr Mrázek <peterix@gmail.com>2016-12-07 01:19:03 +0100
commit2517d2c84d46892e4744bc5cbebb5119a9c9587d (patch)
treea66cac01fdd878ba3ae447dd1a9f7d9eccd0ccbd /application
parent035bdc7576fab3f1757af0e3bd77058bf44748c8 (diff)
downloadMultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar
MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar.gz
MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar.lz
MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar.xz
MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.zip
GH-1743 selected instance can be null - do not assume it isn't
This fixes a crash when closing settings and not having any selected instance.
Diffstat (limited to 'application')
-rw-r--r--application/MainWindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 7b957c70..094eecd7 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -682,7 +682,7 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
void MainWindow::updateToolsMenu()
{
QToolButton *launchButton = dynamic_cast<QToolButton*>(ui->instanceToolBar->widgetForAction(ui->actionLaunchInstance));
- if(m_selectedInstance->isRunning())
+ if(!m_selectedInstance || m_selectedInstance->isRunning())
{
ui->actionLaunchInstance->setMenu(nullptr);
launchButton->setPopupMode(QToolButton::InstantPopup);