Kaynağa Gözat

Merge branch 'develop' of https://github.com/opensheetmusicdisplay/opensheetmusicdisplay into develop

Benjamin Giesinger 7 yıl önce
ebeveyn
işleme
9beac46cdf

+ 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;