Skip to content

Commit de78d5e

Browse files
authored
Fix cannot read properties of undefined (reading 'searchInput') (microsoft#181989)
Fixes microsoft#181948
1 parent a9142bb commit de78d5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vs/workbench/contrib/search/browser/searchView.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ export class SearchView extends ViewPane {
349349
}));
350350

351351
// folder includes list
352-
const folderIncludesList = dom.append(this.queryDetails,
353-
$('.file-types.includes'));
352+
const folderIncludesList = dom.append(this.queryDetails, $('.file-types.includes'));
354353
const filesToIncludeTitle = nls.localize('searchScope.includes', "files to include");
355354
dom.append(folderIncludesList, $('h4', undefined, filesToIncludeTitle));
356355

@@ -1996,6 +1995,11 @@ export class SearchView extends ViewPane {
19961995
}
19971996

19981997
public override saveState(): void {
1998+
// This can be called before renderBody() method gets called for the first time
1999+
// if we move the searchView inside another viewPaneContainer
2000+
if (!this.searchWidget) {
2001+
return;
2002+
}
19992003

20002004
const patternExcludes = this.inputPatternExcludes?.getValue().trim() ?? '';
20012005
const patternIncludes = this.inputPatternIncludes?.getValue().trim() ?? '';

0 commit comments

Comments
 (0)