File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4083,6 +4083,10 @@ void NotationInteraction::moveElementSelection(MoveDirection d)
40834083
40844084 // VBoxes are not included in horizontal layouts - skip over them (and their contents) when moving selections...
40854085 const auto nextNonVBox = [this , isLeftDirection](EngravingItem* currElem) -> EngravingItem* {
4086+ IF_ASSERT_FAILED (currElem) {
4087+ return nullptr ;
4088+ }
4089+
40864090 while (const EngravingItem* vBox = currElem->findAncestor (ElementType::VBOX)) {
40874091 currElem = isLeftDirection ? toVBox (vBox)->prevMM () : toVBox (vBox)->nextMM ();
40884092 if (currElem && currElem->isMeasure ()) {
@@ -4091,7 +4095,12 @@ void NotationInteraction::moveElementSelection(MoveDirection d)
40914095 Measure* mb = toMeasure (currElem);
40924096 currElem = isLeftDirection ? mb->prevElementStaff (si, currElem) : mb->nextElementStaff (si, currElem);
40934097 }
4098+
4099+ if (!currElem) {
4100+ break ;
4101+ }
40944102 }
4103+
40954104 return currElem;
40964105 };
40974106
You can’t perform that action at this time.
0 commit comments