Skip to content

Commit

Permalink
Fixes #32568: A ResolvedKeybinding must have a first part
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Apr 18, 2018
1 parent a443a44 commit 0dc8e7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0dc8e7f

Please sign in to comment.