Skip to content

Commit 9cd87e3

Browse files
committed
TypescriptAPIUtils: fix AppendImportsBuffer
1 parent 6b750ac commit 9cd87e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/typescript-api-utils/sourceFiles/appendImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function appendImport(moduleSpecifier: string, propertyName: string|undef
4242
);
4343
});
4444

45-
if (noImportReuseOnDifferentNames && (<ts.Identifier>existingElement.name).text !== name) {
45+
if (noImportReuseOnDifferentNames && existingElement && (<ts.Identifier>existingElement.name).text !== name) {
4646
existingElement = undefined;
4747
}
4848

0 commit comments

Comments
 (0)