Browse Source

fix previous commit (#588)

Simon Schmid 5 năm trước cách đây
mục cha
commit
1426f766a3
1 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 3 6
      src/MusicalScore/ScoreIO/InstrumentReader.ts

+ 3 - 6
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -476,14 +476,11 @@ export class InstrumentReader {
              this.currentMeasure.endsPiece = true;
            }
           }
-          const barStyleElement: IXmlElement = xmlNode.element("bar-style");
-          if (barStyleElement !== undefined) {
-            const location: Attr = barStyleElement.attribute("location");
-            if (location !== undefined && location.value === "right") {
+          const location: IXmlAttribute = xmlNode.attribute("location");
+          if (location && location.value === "right") {
               this.currentMeasure.endingBarStyle = xmlNode.element("bar-style").value;
-            }
-            // TODO do we need to process bars with left location too?
           }
+          // TODO do we need to process bars with left location too?
         } else if (xmlNode.name === "sound") {
           // (*) MetronomeReader.readTempoInstruction(xmlNode, this.musicSheet, this.currentXmlMeasureIndex);
         } else if (xmlNode.name === "harmony") {