Skip to content

Commit 7232513

Browse files
author
zhengbli
committed
Add nullcheck when calculating indentations for implort clause
1 parent b524795 commit 7232513

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/services/formatting/smartIndenter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ namespace ts.formatting {
497497
return childKind !== SyntaxKind.NamedExports;
498498
case SyntaxKind.ImportDeclaration:
499499
return childKind !== SyntaxKind.ImportClause ||
500-
(<ImportClause>child).namedBindings.kind !== SyntaxKind.NamedImports;
500+
((<ImportClause>child).namedBindings && (<ImportClause>child).namedBindings.kind !== SyntaxKind.NamedImports);
501501
case SyntaxKind.JsxElement:
502502
return childKind !== SyntaxKind.JsxClosingElement;
503503
}

0 commit comments

Comments
 (0)