提交 0d376d89 编写于 作者: R Rob Lourens

Fix NPE when search returns no results

上级 fc773960
......@@ -188,7 +188,9 @@ class TextSearchResultsCollector {
}
private pushToCollector(): void {
const size = this._currentFileMatch.lineMatches.reduce((acc, match) => acc + match.offsetAndLengths.length, 0);
const size = this._currentFileMatch ?
this._currentFileMatch.lineMatches.reduce((acc, match) => acc + match.offsetAndLengths.length, 0) :
0;
this._batchedCollector.addItem(this._currentFileMatch, size);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册