quick bugfix (#78)

This commit is contained in:
Kurt Hutten
2023-03-21 19:02:18 +11:00
committed by GitHub
parent 5f7ee2c512
commit 45091d3c4f
3 changed files with 8 additions and 2 deletions

View File

@ -1272,7 +1272,8 @@ export function addNewSketchLn({
pathToNode,
}: Omit<CreateLineFnCallArgs, 'from'>): { modifiedAst: Program } {
const node = JSON.parse(JSON.stringify(_node))
const { add, updateArgs } = sketchLineHelperMap[fnName]
const { add, updateArgs } = sketchLineHelperMap?.[fnName] || {}
if (!add || !updateArgs) throw new Error('not a sketch line helper')
const { node: varDec } = getNodeFromPath<VariableDeclarator>(
node,
pathToNode,