File tree Expand file tree Collapse file tree
base/browser/ui/keybindingLabel
workbench/contrib/watermark/electron-browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export interface KeybindingLabelOptions {
3333export class KeybindingLabel {
3434
3535 private domNode : HTMLElement ;
36- private keybinding : ResolvedKeybinding ;
36+ private keybinding : ResolvedKeybinding | undefined ;
3737 private matches : Matches | undefined ;
3838 private didEverRender : boolean ;
3939
@@ -47,7 +47,7 @@ export class KeybindingLabel {
4747 return this . domNode ;
4848 }
4949
50- set ( keybinding : ResolvedKeybinding , matches ?: Matches ) {
50+ set ( keybinding : ResolvedKeybinding | undefined , matches ?: Matches ) {
5151 if ( this . didEverRender && this . keybinding === keybinding && KeybindingLabel . areSame ( this . matches , matches ) ) {
5252 return ;
5353 }
Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ export class WatermarkContribution implements IWorkbenchContribution {
146146
147147 private create ( ) : void {
148148 const container = this . partService . getContainer ( Parts . EDITOR_PART ) ;
149+ if ( ! container ) {
150+ throw new Error ( 'Could not find container' ) ;
151+ }
149152 container . classList . add ( 'has-watermark' ) ;
150153
151154 this . watermark = $ ( '.watermark' ) ;
@@ -176,7 +179,10 @@ export class WatermarkContribution implements IWorkbenchContribution {
176179 private destroy ( ) : void {
177180 if ( this . watermark ) {
178181 this . watermark . remove ( ) ;
179- this . partService . getContainer ( Parts . EDITOR_PART ) . classList . remove ( 'has-watermark' ) ;
182+ const container = this . partService . getContainer ( Parts . EDITOR_PART ) ;
183+ if ( container ) {
184+ container . classList . remove ( 'has-watermark' ) ;
185+ }
180186 this . dispose ( ) ;
181187 }
182188 }
You can’t perform that action at this time.
0 commit comments