Skip to content

Commit

Permalink
fix #280814 add timesig to meas w/some clefs
Browse files Browse the repository at this point in the history
Fixes a crash when adding a timesig to a measure that has at least one clef but where not all staves have clef for that measure.  Crash was result of a NULL defreference on the first staff that didn't have a clef in that clef segment.

Fix is simple to make sure to test that clef is non-NULL before dereferencing it.
  • Loading branch information
Eric Fontaine committed Dec 29, 2018
1 parent cf1f5ce commit 641ac7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ std::vector<Clef*> InsertRemoveMeasures::getCourtesyClefs(Measure* m)
if (clefSeg) {
for (int st = 0; st < score->nstaves(); ++st) {
Element* clef = clefSeg->element(staff2track(st));
if (clef->isClef())
if (clef && clef->isClef())
startClefs.push_back(toClef(clef));
}
}
Expand Down

0 comments on commit 641ac7a

Please sign in to comment.