mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Handle the case where the FAR results map is empty (#49254)
* Handle the case where the FAR results map is empty Searching exactly one project does not imply the presence of exactly one references list. Fixes #49217 * Use emptyArray Co-authored-by: Sheetal Nandi <shkamat@microsoft.com> Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
This commit is contained in:
@@ -575,8 +575,7 @@ namespace ts.server {
|
||||
// it easier for the caller to skip post-processing.
|
||||
if (searchedProjects.size === 1) {
|
||||
const it = resultsMap.values().next();
|
||||
Debug.assert(!it.done);
|
||||
return it.value;
|
||||
return it.done ? emptyArray : it.value; // There may not be any results at all
|
||||
}
|
||||
|
||||
return resultsMap;
|
||||
|
||||
Reference in New Issue
Block a user