mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Fixes #11868: Check that the user keybindings are parsed as an array
This commit is contained in:
@@ -147,14 +147,22 @@ export class WorkbenchKeybindingService extends KeybindingService {
|
||||
this._beginListening(domNode);
|
||||
}
|
||||
|
||||
private _safeGetConfig(): IUserFriendlyKeybinding[] {
|
||||
let rawConfig = this.userKeybindings.getConfig();
|
||||
if (Array.isArray(rawConfig)) {
|
||||
return rawConfig;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
public customKeybindingsCount(): number {
|
||||
let userKeybindings = this.userKeybindings.getConfig();
|
||||
let userKeybindings = this._safeGetConfig();
|
||||
|
||||
return userKeybindings.length;
|
||||
}
|
||||
|
||||
protected _getExtraKeybindings(isFirstTime: boolean): IKeybindingItem[] {
|
||||
let extraUserKeybindings: IUserFriendlyKeybinding[] = this.userKeybindings.getConfig();
|
||||
let extraUserKeybindings: IUserFriendlyKeybinding[] = this._safeGetConfig();
|
||||
if (!isFirstTime) {
|
||||
let cnt = extraUserKeybindings.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user