diff --git a/src/engraving/dom/note.cpp b/src/engraving/dom/note.cpp index f55cfc5c59aa4..8794c458e7f4d 100644 --- a/src/engraving/dom/note.cpp +++ b/src/engraving/dom/note.cpp @@ -1887,7 +1887,11 @@ EngravingItem* Note::drop(EditData& data) DirectionV stemDirection = DirectionV::AUTO; if (staffGroup == StaffGroup::PERCUSSION) { const Drumset* ds = st->part()->instrument(segment->tick())->drumset(); - stemDirection = ds->stemDirection(n->noteVal().pitch); + DO_ASSERT(ds); + + if (ds) { + stemDirection = ds->stemDirection(n->noteVal().pitch); + } } ch->setStemDirection(stemDirection); diff --git a/src/engraving/dom/noteentry.cpp b/src/engraving/dom/noteentry.cpp index 7fc0795bdec73..ead54c0198d31 100644 --- a/src/engraving/dom/noteentry.cpp +++ b/src/engraving/dom/noteentry.cpp @@ -434,7 +434,11 @@ Ret Score::putNote(const Position& p, bool replace) switch (staffGroup) { case StaffGroup::PERCUSSION: { const Drumset* ds = st->part()->instrument(s->tick())->drumset(); - stemDirection = ds->stemDirection(nval.pitch); + DO_ASSERT(ds); + + if (ds) { + stemDirection = ds->stemDirection(nval.pitch); + } break; } case StaffGroup::TAB: diff --git a/src/engraving/dom/paste.cpp b/src/engraving/dom/paste.cpp index 704f4df59314a..0c1d8cd690b94 100644 --- a/src/engraving/dom/paste.cpp +++ b/src/engraving/dom/paste.cpp @@ -312,7 +312,11 @@ static Note* prepareTarget(ChordRest* target, Note* with, const Fraction& durati DirectionV stemDirection = DirectionV::AUTO; if (staffGroup == StaffGroup::PERCUSSION) { const Drumset* ds = staff->part()->instrument(segment->tick())->drumset(); - stemDirection = ds->stemDirection(with->noteVal().pitch); + DO_ASSERT(ds); + + if (ds) { + stemDirection = ds->stemDirection(with->noteVal().pitch); + } } segment = target->score()->setNoteRest(segment, target->track(),