Преглед на файлове

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