Merge pull request #9426 from zhengbli/fix9411

Add nullcheck when calculating indentations for implort clause
This commit is contained in:
Zhengbo Li
2016-06-30 14:21:11 -07:00
committed by GitHub
2 changed files with 27 additions and 1 deletions

View File

@@ -497,7 +497,7 @@ namespace ts.formatting {
return childKind !== SyntaxKind.NamedExports;
case SyntaxKind.ImportDeclaration:
return childKind !== SyntaxKind.ImportClause ||
(<ImportClause>child).namedBindings.kind !== SyntaxKind.NamedImports;
((<ImportClause>child).namedBindings && (<ImportClause>child).namedBindings.kind !== SyntaxKind.NamedImports);
case SyntaxKind.JsxElement:
return childKind !== SyntaxKind.JsxClosingElement;
}