Skip to content

Commit

Permalink
SearchProvider - fix NPE when searching extraFileResources
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Aug 2, 2018
1 parent ec78bd9 commit c86cab2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/vs/workbench/api/node/extHostSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,16 @@ class FileSearchManager {
}

private rawMatchToSearchItem(match: IInternalFileMatch): IFileMatch {
return {
resource: resources.joinPath(match.base, match.relativePath)
};
if (match.relativePath) {
return {
resource: resources.joinPath(match.base, match.relativePath)
};
} else {
// extraFileResources
return {
resource: match.base
};
}
}

private doSearch(engine: FileSearchEngine, batchSize: number, onResultBatch: (matches: IInternalFileMatch[]) => void): TPromise<IInternalSearchComplete> {
Expand Down

0 comments on commit c86cab2

Please sign in to comment.