Skip to content

Commit d1f0946

Browse files
committed
fix: check if parseFunctionBody fails
1 parent 29ebad7 commit d1f0946

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/openapi-generator/src/codec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ export function parseCodecInitializer(
510510
if (E.isRight(calleeInitE)) {
511511
const [calleeSourceFile, calleeInit] = calleeInitE.right;
512512
if (calleeInit !== null && calleeInit.type === 'ArrowFunctionExpression') {
513-
return parseFunctionBody(project, calleeSourceFile, calleeInit);
513+
const bodyResult = parseFunctionBody(project, calleeSourceFile, calleeInit);
514+
if (E.isRight(bodyResult)) {
515+
return bodyResult;
516+
}
514517
}
515518
}
516519
}

0 commit comments

Comments
 (0)