Skip to content

Commit

Permalink
Merge pull request #1608 from MarcSabatella/43176-line-move-crash
Browse files Browse the repository at this point in the history
fix #43176: crash on attempted move of line
  • Loading branch information
MarcSabatella committed Jan 2, 2015
2 parents cf6ff85 + b3e42b7 commit f78aca0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,9 @@ Element* Score::move(const QString& cmd)
// cr is the ChordRest to move from on other cmd's
int track = el->track(); // keep note of element track
el = el->parent();
// element with no parent (eg, a newly-added line) - no way to find context
if (!el)
return 0;
switch (el->type()) {
case Element::Type::NOTE: // a note is a valid target
trg = el;
Expand All @@ -1768,7 +1771,7 @@ Element* Score::move(const QString& cmd)
// if segment is not chord/rest or grace, move to next chord/rest or grace segment
if (!seg->isChordRest()) {
seg = seg->next1(Segment::Type::ChordRest);
if (seg == 0) // if none found, reutrn failure
if (seg == 0) // if none found, return failure
return 0;
}
// segment for sure contains chords/rests,
Expand Down

0 comments on commit f78aca0

Please sign in to comment.