mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Merge pull request #285608 from microsoft/dev/dmitriv/scm-view-pane-getParent-crash
Handle more cases in scmViewPane.getParent
This commit is contained in:
@@ -3070,6 +3070,8 @@ class SCMTreeDataSource extends Disposable implements IAsyncDataSource<ISCMViewS
|
||||
return result;
|
||||
} else if (isSCMInput(element)) {
|
||||
return element.repository;
|
||||
} else if (isSCMActionButton(element)) {
|
||||
return element.repository;
|
||||
} else if (isSCMResourceGroup(element)) {
|
||||
const repository = this.scmViewService.visibleRepositories.find(r => r.provider === element.provider);
|
||||
if (!repository) {
|
||||
@@ -3077,6 +3079,8 @@ class SCMTreeDataSource extends Disposable implements IAsyncDataSource<ISCMViewS
|
||||
}
|
||||
|
||||
return repository;
|
||||
} else if (isSCMRepository(element)) {
|
||||
return this.scmViewService;
|
||||
} else {
|
||||
throw new Error('Unexpected call to getParent');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user