Skip to content

Commit

Permalink
fix: do not crash on part not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Jun 9, 2023
1 parent f63bc39 commit 7c50463
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/service-override/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ class PaneCompositePartService implements IPaneCompositePartService {
}

getPaneComposites (viewContainerLocation: ViewContainerLocation) {
return this.getPartByLocation(viewContainerLocation)!.getPaneComposites()
return this.getPartByLocation(viewContainerLocation)?.getPaneComposites() ?? []
}

getPinnedPaneCompositeIds (viewContainerLocation: ViewContainerLocation): string[] {
return this.getSelectorPartByLocation(viewContainerLocation)!.getPinnedPaneCompositeIds()
return this.getSelectorPartByLocation(viewContainerLocation)?.getPinnedPaneCompositeIds() ?? []
}

getVisiblePaneCompositeIds (viewContainerLocation: ViewContainerLocation): string[] {
return this.getSelectorPartByLocation(viewContainerLocation)!.getVisiblePaneCompositeIds()
return this.getSelectorPartByLocation(viewContainerLocation)?.getVisiblePaneCompositeIds() ?? []
}

getProgressIndicator (id: string, viewContainerLocation: ViewContainerLocation): IProgressIndicator | undefined {
return this.getPartByLocation(viewContainerLocation)!.getProgressIndicator(id)
return this.getPartByLocation(viewContainerLocation)?.getProgressIndicator(id)
}

hideActivePaneComposite (viewContainerLocation: ViewContainerLocation): void {
this.getPartByLocation(viewContainerLocation)!.hideActivePaneComposite()
this.getPartByLocation(viewContainerLocation)?.hideActivePaneComposite()
}

getLastActivePaneCompositeId (viewContainerLocation: ViewContainerLocation): string {
Expand Down

0 comments on commit 7c50463

Please sign in to comment.