Переглянути джерело

fix: added fix in repetition comparer (from PR #251)

Matthias Uiberacker 7 роки тому
батько
коміт
9c7e164bdb

+ 7 - 1
src/MusicalScore/VoiceData/Instructions/RepetitionInstruction.ts

@@ -126,10 +126,16 @@ export class RepetitionInstruction /*implements IComparable*/ {
             this.measureIndex !== other.measureIndex
             || this.type !== other.type
             || this.alignment !== other.alignment
-            || this.endingIndices.length !== other.endingIndices.length
         ) {
             return false;
         }
+        if (this.endingIndices === other.endingIndices) {
+            return true;
+        }
+        if (this.endingIndices === undefined || other.endingIndices === undefined ||
+            this.endingIndices.length !== other.endingIndices.length) {
+            return false;
+        }
         for (let i: number = 0; i < this.endingIndices.length; i++) {
             if (this.endingIndices[i] !== other.endingIndices[i]) {
                 return false;