From 4118680b975ad3654e6f087cd261fc0b4ed51eca Mon Sep 17 00:00:00 2001 From: Howard-C Date: Sat, 25 Jan 2020 16:04:43 +0800 Subject: [PATCH] fix #300107: crash after closing a menu bar pop-up window if no score is loaded --- mscore/plugin/qmlpluginengine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mscore/plugin/qmlpluginengine.cpp b/mscore/plugin/qmlpluginengine.cpp index 5f164d544abf7..45de34e7f0352 100644 --- a/mscore/plugin/qmlpluginengine.cpp +++ b/mscore/plugin/qmlpluginengine.cpp @@ -48,7 +48,9 @@ void QmlPluginEngine::beginEndCmd(MuseScore* ms, bool inUndoRedo) undoRedo = true; const Score* cs = ms->currentScore(); - currScoreState = cs->masterScore()->state(); // score and excerpts have united undo stack so we are better to track master score + + // score and excerpts have united undo stack so we are better to track master score + currScoreState = cs ? cs->masterScore()->state() : ScoreContentState(); // TODO: most of plugins are never deleted so receivers usually never decrease if (!receivers(SIGNAL(endCmd(const QMap&))))