Skip to content

Commit 4e56fc0

Browse files
committed
Properly guard for undefined in getTypeReferenceArity
1 parent 2e8d11e commit 4e56fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4979,7 +4979,7 @@ namespace ts {
49794979
}
49804980

49814981
function getTypeReferenceArity(type: TypeReference): number {
4982-
return type.target.typeParameters.length;
4982+
return type.target.typeParameters ? type.target.typeParameters.length : 0;
49834983
}
49844984

49854985
// Get type from reference to class or interface

0 commit comments

Comments
 (0)