Skip to content

Commit e4ce3f6

Browse files
committed
fix: Ensure null is never put into visited types memory
1 parent 8bd09d1 commit e4ce3f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/getFlowType.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,15 @@ function getFlowTypeWithResolvedTypes(path: NodePath): FlowTypeDescriptor {
273273
}
274274
}
275275

276+
if (!type) {
277+
type = { name: 'unknown' };
278+
}
279+
276280
if (isTypeAlias) {
277281
// mark the type as unvisited so that further calls can resolve the type again
278282
visitedTypes[path.parentPath.node.id.name] = type;
279283
}
280284

281-
if (!type) {
282-
type = { name: 'unknown' };
283-
}
284-
285285
return type;
286286
}
287287

0 commit comments

Comments
 (0)