Merge branch 'rochade' into master
[alioth/musescore.git] / debian / patches / upstream / crash-triplet.diff
index 9ef1828..d28075b 100644 (file)
@@ -1,17 +1,21 @@
-Origin: backport, commit:f654f707997610f7de96eeaeadda1ad296034630
+Origin: upstream, commit:f654f707997610f7de96eeaeadda1ad296034630
 Author: Rory McLeod <mcleodnw@gmail.com>
 Description: fix #285040 crash when changing a triplet's rest's duration
  - Prevent a null pointer deref when searching a linked tuplet.
 
---- a/libmscore/undo.cpp
-+++ b/libmscore/undo.cpp
-@@ -1419,7 +1419,8 @@ void Score::undoAddCR(ChordRest* cr, Mea
-                               if (nt == 0)
-                                     qDebug("linked tuplet not found");
+--- a/libmscore/edit.cpp
++++ b/libmscore/edit.cpp
+@@ -4743,8 +4743,11 @@ void Score::undoAddCR(ChordRest* cr, Mea
+                                     if (nt == 0)
+                                           qWarning("linked tuplet not found");
+                                     }
+-                              newcr->setTuplet(nt);
+-                              nt->setParent(newcr->measure());
++
++                              if (nt) {
++                                    newcr->setTuplet(nt);
++                                    nt->setParent(newcr->measure());
++                                    }
                                }
--                        newcr->setTuplet(nt);
-+                        if (nt)
-+                              newcr->setTuplet(nt);
                          }
-                   }
-             undo(new AddElement(newcr));