Skip to content

Commit 4e262ef

Browse files
authored
fix(visitors): isErrorFirstCallback return false if firstParam is undefined (#272)
1 parent e2444d4 commit 4e262ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/visitors/functionTypes/visit.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ export function newVisit(
4747
return false;
4848
}
4949
const firstParam = paramTypeNode.parameters[0];
50+
if (firstParam === undefined) {
51+
if (process.env.NODE_ENV === 'test') {
52+
console.log('firstParam is undefined');
53+
}
54+
return false;
55+
}
5056
const firstParamSymbol = checker.getSymbolAtLocation(firstParam.name);
5157
if (firstParamSymbol === undefined) {
5258
if (process.env.NODE_ENV === 'test') {

0 commit comments

Comments
 (0)