From 56e5491e5ca9cd5ad5fd987a550bebc5503652c3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 9 Jul 2020 23:06:32 -0400 Subject: [PATCH] Ensures safe startup. --- OSBindings/Qt/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp index ec87b29c6..b059bf561 100644 --- a/OSBindings/Qt/mainwindow.cpp +++ b/OSBindings/Qt/mainwindow.cpp @@ -759,7 +759,7 @@ void MainWindow::setWindowTitle() { void MainWindow::changeEvent(QEvent *event) { // Clear current key state upon any window activation change. - if(event->type() == QEvent::ActivationChange) { + if(machine && event->type() == QEvent::ActivationChange) { const auto keyboardMachine = machine->keyboard_machine(); if(keyboardMachine) { keyboardMachine->clear_all_keys();