diff --git a/src/services/completions.ts b/src/services/completions.ts index 8cca9b678d93e..b4276e3c3d2ec 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -117,7 +117,7 @@ namespace ts.Completions { // If the symbol/moduleSymbol was a merged symbol, it will have a new identity // in the checker, even though the symbols to merge are the same (guaranteed by // cache invalidation in synchronizeHostData). - if (suggestion.symbol.declarations) { + if (suggestion.symbol.declarations && suggestion.symbol.declarations[0]) { suggestion.symbol = checker.getMergedSymbol(suggestion.origin.isDefaultExport ? suggestion.symbol.declarations[0].localSymbol || suggestion.symbol.declarations[0].symbol : suggestion.symbol.declarations[0].symbol);