Skip to content

Commit

Permalink
Merge pull request #4137 from blackears/278232-crash-deleting-staff
Browse files Browse the repository at this point in the history
fix #278232 Crash when deleting staff while open in PianoRoll
  • Loading branch information
anatoly-os committed Nov 14, 2018
2 parents 2264301 + b1fc556 commit c9fe878
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mscore/pianolevels.cpp
Expand Up @@ -546,7 +546,9 @@ void PianoLevels::updateNotes()
return;
}

int staffIdx = _staff->idx();
int staffIdx = _staff->idx();
if (staffIdx == -1)
return;

SegmentType st = SegmentType::ChordRest;
for (Segment* s = _staff->score()->firstSegment(st); s; s = s->next1(st)) {
Expand Down
4 changes: 3 additions & 1 deletion mscore/pianoview.cpp
Expand Up @@ -1104,7 +1104,9 @@ void PianoView::updateNotes()
scene()->clear();
clearNoteData();

int staffIdx = _staff->idx();
int staffIdx = _staff->idx();
if (staffIdx == -1)
return;

SegmentType st = SegmentType::ChordRest;
for (Segment* s = _staff->score()->firstSegment(st); s; s = s->next1(st)) {
Expand Down

0 comments on commit c9fe878

Please sign in to comment.