diff --git a/src/Gui/ShortcutManager.cpp b/src/Gui/ShortcutManager.cpp index 566bd8c8fd3c..bf6f3d912080 100644 --- a/src/Gui/ShortcutManager.cpp +++ b/src/Gui/ShortcutManager.cpp @@ -453,8 +453,10 @@ void ShortcutManager::onTimer() if (it->key.shortcut != k) { QKeyEvent keyPress(QEvent::KeyPress, s, Qt::ControlModifier, 0, 0, 0); QApplication::sendEvent(lastFocus, &keyPress); - QKeyEvent keyRelease(QEvent::KeyRelease, s, Qt::ControlModifier, 0, 0, 0); - QApplication::sendEvent(lastFocus, &keyRelease); + if (lastFocus) { + QKeyEvent keyRelease(QEvent::KeyRelease, s, Qt::ControlModifier, 0, 0, 0); + QApplication::sendEvent(lastFocus, &keyRelease); + } break; } }