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:
parent
54f78637fa
commit
2d0b63d5cd
2 changed files with 13 additions and 1 deletions
5
.changeset/rare-trees-peel.md
Normal file
5
.changeset/rare-trees-peel.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"penpot-exporter": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix vector network error on invalid access to the property
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue