浏览代码

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

Benjamin Giesinger 7 年之前
父节点
当前提交
9beac46cdf
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/MusicalScore/VoiceData/Instructions/RepetitionInstruction.ts

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