File: 745ae112a14dab30be263762f942136cc0629dcf.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 218,192 kB
  • sloc: cpp: 291,369; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 249; perl: 82; pascal: 79
file content (38 lines) | stat: -rw-r--r-- 1,718 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Forwarded: part of Origin PR by Jojo-Schmitz
Origin: https://github.com/musescore/MuseScore/pull/9000
Author: larry <gudrun>
Description: Fix #274126 Crash when entering music on top of an unterminated slur by MIDI

--- a/libmscore/noteentry.cpp
+++ b/libmscore/noteentry.cpp
@@ -245,17 +245,19 @@ Note* Score::addPitch(NoteVal& nval, boo
             if (e) {
                   Fraction stick = Fraction(0, 1);
                   Element* ee = _is.slur()->startElement();
-                  if (ee->isChordRest())
-                        stick = toChordRest(ee)->tick();
-                  else if (ee->isNote())
-                        stick = toNote(ee)->chord()->tick();
-                  if (stick == e->tick()) {
-                        _is.slur()->setTick(stick);
-                        _is.slur()->setStartElement(e);
-                        }
-                  else {
-                        _is.slur()->setTick2(e->tick());
-                        _is.slur()->setEndElement(e);
+                  if (ee) {
+                        if (ee->isChordRest())
+                              stick = toChordRest(ee)->tick();
+                        else if (ee->isNote())
+                              stick = toNote(ee)->chord()->tick();
+                        if (stick == e->tick()) {
+                              _is.slur()->setTick(stick);
+                              _is.slur()->setStartElement(e);
+                              }
+                        else {
+                              _is.slur()->setTick2(e->tick());
+                              _is.slur()->setEndElement(e);
+                              }
                         }
                   }
             else