mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Fix crash on non-dts-require (#19980)
This commit is contained in:
@@ -17179,7 +17179,7 @@ namespace ts {
|
||||
if (targetDeclarationKind !== SyntaxKind.Unknown) {
|
||||
const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
|
||||
// function/variable declaration should be ambient
|
||||
return !!(decl.flags & NodeFlags.Ambient);
|
||||
return !!decl && !!(decl.flags & NodeFlags.Ambient);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user