소스 검색

fix(lyrics): fix null reference for lyrics dashes when drawing range set

happened for Beethoven Geliebte, if {drawUpToMeasure: 4} set.
sschmid 5 년 전
부모
커밋
a19b3cd6b8
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/MusicalScore/Graphical/MusicSheetCalculator.ts

+ 2 - 1
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -2338,7 +2338,8 @@ export abstract class MusicSheetCalculator {
             this.calculateDashes(startStaffLine, startX, endX, y);
 
             // calculate Dashes for the second StaffLine (only if endStaffEntry isn't the first StaffEntry of the StaffLine)
-            if (nextStaffLine &&
+            if (nextStaffLine && // check for undefined objects e.g. when drawingRange given
+                nextStaffLine.Measures[0] &&
                 endStaffentry.parentMeasure.ParentStaffLine &&
                 !(endStaffentry === endStaffentry.parentMeasure.staffEntries[0] &&
                 endStaffentry.parentMeasure === endStaffentry.parentMeasure.ParentStaffLine.Measures[0])) {