Browse Source

fix(ties): fix error in tie handling when no end note found

sschmidTU 6 years ago
parent
commit
3757db54dc
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/MusicalScore/Graphical/MusicSheetCalculator.ts

+ 3 - 0
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -1845,6 +1845,9 @@ export abstract class MusicSheetCalculator {
         for (let i: number = 1; i < tie.Notes.length; i++) {
             startNote = startGse.findEndTieGraphicalNoteFromNote(tie.Notes[i - 1]);
             endGse = this.graphicalMusicSheet.GetGraphicalFromSourceStaffEntry(tie.Notes[i].ParentStaffEntry);
+            if (!endGse) {
+                continue;
+            }
             endNote = endGse.findEndTieGraphicalNoteFromNote(tie.Notes[i]);
             if (startNote !== undefined && endNote !== undefined && endGse !== undefined) {
                 if (!startNote.sourceNote.PrintObject || !endNote.sourceNote.PrintObject) {