Quellcode durchsuchen

Fix for undefined parentStaff in GraphicalVoiceEntry creation

Benjamin Giesinger vor 7 Jahren
Ursprung
Commit
bf97fca9ec
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  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 = [];
     }