Parcourir la source

Fix for undefined parentStaff in GraphicalVoiceEntry creation

Benjamin Giesinger il y a 7 ans
Parent
commit
bf97fca9ec
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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 = [];
     }