Skip to content

Commit

Permalink
Merge pull request #6184 from MarcSabatella/305293-no-drumset-crash
Browse files Browse the repository at this point in the history
fix #305293: crash on load of score with missing drumset
  • Loading branch information
anatoly-os committed Jun 10, 2020
1 parent 01b8867 commit 82436a1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,18 @@ SymId Note::noteHead() const

if (_headGroup == NoteHead::Group::HEAD_CUSTOM) {
if (st) {
if (st->staffTypeForElement(chord())->isDrumStaff())
return st->part()->instrument(chord()->tick())->drumset()->noteHeads(_pitch, ht);
if (st->staffTypeForElement(chord())->isDrumStaff()) {
Fraction t = chord()->tick();
Instrument* inst = st->part()->instrument(t);
Drumset* d = inst->drumset();
if (d) {
return d->noteHeads(_pitch, ht);
}
else {
qDebug("no drumset");
return noteHead(up, NoteHead::Group::HEAD_NORMAL, ht);
}
}
}
else {
return _cachedNoteheadSym;
Expand Down

0 comments on commit 82436a1

Please sign in to comment.