diff --git a/.changeset/rare-trees-peel.md b/.changeset/rare-trees-peel.md new file mode 100644 index 0000000..95006e3 --- /dev/null +++ b/.changeset/rare-trees-peel.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": patch +--- + +Fix vector network error on invalid access to the property diff --git a/plugin-src/transformers/partials/transformVectorPaths.ts b/plugin-src/transformers/partials/transformVectorPaths.ts index f02e3b5..740a549 100644 --- a/plugin-src/transformers/partials/transformVectorPaths.ts +++ b/plugin-src/transformers/partials/transformVectorPaths.ts @@ -14,7 +14,14 @@ import { translateCommands, translateWindingRule } from '@plugin/translators/vec import { PathShape } from '@ui/lib/types/shapes/pathShape'; export const transformVectorPaths = (node: VectorNode): PathShape[] => { - const regions = node.vectorNetwork?.regions ?? []; + let regions: readonly VectorRegion[] = []; + + try { + regions = node.vectorNetwork?.regions ?? []; + } catch (error) { + console.error('Error accessing vector network', node, error); + } + const strokeLength = node.strokes.length; const pathShapes = node.vectorPaths