Skip to content

Commit

Permalink
Fix #315726: Applying key change to a selection causes crash if trans…
Browse files Browse the repository at this point in the history
…posing instrument is involved.

Resolves: https://musescore.org/en/node/315726.

The new KeySig element does not have a part yet, because it has not yet been added to the score.
  • Loading branch information
mattmcclinch authored and vpereverzev committed Jan 25, 2021
1 parent 988d5d7 commit 3ecd9c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mscore/palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ bool Palette::applyPaletteElement(Element* element, Qt::KeyboardModifiers modifi
Interval v = staff->part()->instrument(tick1)->transpose();
if (!v.isZero()) {
Key k = okeysig->key();
okeysig->setKey(transposeKey(k, v, okeysig->part()->preferSharpFlat()));
okeysig->setKey(transposeKey(k, v, staff->part()->preferSharpFlat()));
}
}
oelement = okeysig;
Expand Down

0 comments on commit 3ecd9c5

Please sign in to comment.