Procházet zdrojové kódy

Fix for undefined parentStaff in GraphicalVoiceEntry creation

Benjamin Giesinger před 7 roky
rodič
revize
bf97fca9ec

+ 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 = [];
     }