mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Fix collapseAll
command when no folder is open (#180330)
* check view is not null before casting to `ExplorerView` * explicit `null` check
This commit is contained in:
parent
2f07466dfc
commit
86528d8df2
|
@ -991,7 +991,10 @@ registerAction2(class extends Action2 {
|
|||
|
||||
run(accessor: ServicesAccessor) {
|
||||
const viewsService = accessor.get(IViewsService);
|
||||
const explorerView = viewsService.getViewWithId(VIEW_ID) as ExplorerView;
|
||||
const view = viewsService.getViewWithId(VIEW_ID);
|
||||
if (view !== null) {
|
||||
const explorerView = view as ExplorerView;
|
||||
explorerView.collapseAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue