Skip to content

Commit

Permalink
Merge pull request #3719 from dmitrio95/bugfix/tie_paste_crash
Browse files Browse the repository at this point in the history
fix #273159: Crash when pasting note with a tie to the new score. The note must be placed in the staff with a bigger number than total number of staves in a new score.
  • Loading branch information
anatoly-os committed Jun 14, 2018
2 parents 93a63c6 + e0188ff commit 1561780
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libmscore/note.cpp
Expand Up @@ -1417,7 +1417,7 @@ bool Note::readProperties(XmlReader& e)
if (id != -1 &&
// DISABLE if pasting into a staff with linked staves
// because the glissando is not properly cloned into the linked staves
(!e.pasteMode() || !staff()->links() || staff()->links()->empty())) {
staff() && (!e.pasteMode() || !staff()->links() || staff()->links()->empty())) {
Spanner* placeholder = new TextLine(score());
placeholder->setAnchor(Spanner::Anchor::NOTE);
placeholder->setEndElement(this);
Expand Down Expand Up @@ -1453,7 +1453,7 @@ bool Note::readProperties(XmlReader& e)
sp->read(e);
// DISABLE pasting of glissandi into staves with other lionked staves
// because the glissando is not properly cloned into the linked staves
if (e.pasteMode() && staff()->links() && !staff()->links()->empty()) {
if (e.pasteMode() && staff() && staff()->links() && !staff()->links()->empty()) {
e.removeSpanner(sp); // read() added the element to the XMLReader: remove it
delete sp;
}
Expand Down

0 comments on commit 1561780

Please sign in to comment.