diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx index c7b7ed47ee9c5..82756e7287185 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx @@ -315,9 +315,13 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { if (currentTitle && currentTitle.owner instanceof EditorWidget) { const widget = currentTitle.owner; const fileNodes = this.getFileNodesByUri(widget.editor.uri); - fileNodes.forEach(node => { - this.decorateEditor(node, widget); - }); + if (fileNodes.length > 0) { + fileNodes.forEach(node => { + this.decorateEditor(node, widget); + }); + } else { + this.decorateEditor(undefined, widget); + } } });