mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-25 04:36:23 +00:00
Working on strict null checking with Map.get may return undefined
This commit is contained in:
@@ -118,7 +118,7 @@ export class MenuBar extends Disposable {
|
||||
} else if (event.equals(KeyCode.Escape) && this.isFocused && !this.isOpen) {
|
||||
this.setUnfocusedState();
|
||||
} else if (!this.isOpen && !event.ctrlKey && this.options.enableMnemonics && this.mnemonicsInUse && this.mnemonics.has(key)) {
|
||||
const menuIndex = this.mnemonics.get(key);
|
||||
const menuIndex = this.mnemonics.get(key)!;
|
||||
this.onMenuTriggered(menuIndex, false);
|
||||
} else {
|
||||
eventHandled = false;
|
||||
@@ -171,7 +171,7 @@ export class MenuBar extends Disposable {
|
||||
this.mnemonicsInUse = true;
|
||||
this.updateMnemonicVisibility(true);
|
||||
|
||||
const menuIndex = this.mnemonics.get(key);
|
||||
const menuIndex = this.mnemonics.get(key)!;
|
||||
this.onMenuTriggered(menuIndex, false);
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user