瀏覽代碼

Fix for undefined parentStaff in GraphicalVoiceEntry creation

Benjamin Giesinger 7 年之前
父節點
當前提交
bf97fca9ec
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/MusicalScore/Graphical/GraphicalVoiceEntry.ts

+ 1 - 1
src/MusicalScore/Graphical/GraphicalVoiceEntry.ts

@@ -12,7 +12,7 @@ export class GraphicalVoiceEntry extends GraphicalObject {
         super();
         this.parentVoiceEntry = parentVoiceEntry;
         this.parentStaffEntry = parentStaffEntry;
-        this.PositionAndShape = new BoundingBox(this, parentStaffEntry.PositionAndShape);
+        this.PositionAndShape = new BoundingBox(this, parentStaffEntry ? parentStaffEntry.PositionAndShape : undefined);
         this.notes = [];
     }