提交 0dc8e7f5 编写于 作者: A Alex Dima

Fixes #32568: A ResolvedKeybinding must have a first part

上级 a443a44f
......@@ -21,8 +21,7 @@ export class USLayoutResolvedKeybinding extends ResolvedKeybinding {
super();
this._os = OS;
if (actual === null) {
this._firstPart = null;
this._chordPart = null;
throw new Error(`Invalid USLayoutResolvedKeybinding`);
} else if (actual.type === KeybindingType.Chord) {
this._firstPart = actual.firstPart;
this._chordPart = actual.chordPart;
......
......@@ -74,6 +74,9 @@ export class NativeResolvedKeybinding extends ResolvedKeybinding {
constructor(mapper: MacLinuxKeyboardMapper, OS: OperatingSystem, firstPart: ScanCodeBinding, chordPart: ScanCodeBinding) {
super();
if (!firstPart) {
throw new Error(`Invalid USLayoutResolvedKeybinding`);
}
this._mapper = mapper;
this._OS = OS;
this._firstPart = firstPart;
......
......@@ -86,6 +86,9 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding {
constructor(mapper: WindowsKeyboardMapper, firstPart: SimpleKeybinding, chordPart: SimpleKeybinding) {
super();
if (!firstPart) {
throw new Error(`Invalid WindowsNativeResolvedKeybinding firstPart`);
}
this._mapper = mapper;
this._firstPart = firstPart;
this._chordPart = chordPart;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册