0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00

Fix vector network error on invalid access to the property (#225)

* Fix vector network error on invalid access to the property

* Add changeset
This commit is contained in:
Jordi Sala Morales 2024-10-08 11:27:32 +02:00 committed by GitHub
parent 54f78637fa
commit 2d0b63d5cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"penpot-exporter": patch
---
Fix vector network error on invalid access to the property

View file

@ -14,7 +14,14 @@ import { translateCommands, translateWindingRule } from '@plugin/translators/vec
import { PathShape } from '@ui/lib/types/shapes/pathShape'; import { PathShape } from '@ui/lib/types/shapes/pathShape';
export const transformVectorPaths = (node: VectorNode): 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 strokeLength = node.strokes.length;
const pathShapes = node.vectorPaths const pathShapes = node.vectorPaths