Skip to content

AI-native design editor. Open-source Figma alternative.

fix(fig): guard unresolved component property swaps

Danila Poyarkov40b56dab5e3d
diff --git a/packages/fig/src/instance-overrides/component-props/apply.ts b/packages/fig/src/instance-overrides/component-props/apply.ts
index 265e36fde..e7aaa6345 100644
--- a/packages/fig/src/instance-overrides/component-props/apply.ts
+++ b/packages/fig/src/instance-overrides/component-props/apply.ts
@@ -62,6 +62,7 @@ function applySwapProp(
const swapId =
propTextCharacters(val) ?? (val.guidValue ? guidToString(val.guidValue) : undefined)
const newCompId = swapId ? ctx.guidToNodeId.get(swapId) : undefined
+ if (!newCompId) return
const currentCompId = ctx.graph.getNode(childId)?.componentId
if (currentCompId && getComponentRoot(ctx, currentCompId) === getComponentRoot(ctx, newCompId)) {
return