Skip to content

Commit

Permalink
initialize name before using it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhenon committed Oct 27, 2024
1 parent b810e0c commit 5f308e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/svgcanvas/core/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ export class Drawing {

// If orphans or no layers found, create a new layer and add all the orphans to it
if (orphans.length > 0 || !childgroups) {
layer = new Layer(getNewLayerName(layernames), null, this.svgElem_)
const name = getNewLayerName(layernames)
layer = new Layer(name, null, this.svgElem_)
layer.appendChildren(orphans)
this.all_layers.push(layer)
this.layer_map[name] = layer
Expand Down

0 comments on commit 5f308e4

Please sign in to comment.