Skip to content

Commit 8fbf9f0

Browse files
authored
fix(remotecontrol) Fix crash when key event key is missing (#293)
1 parent 49834b1 commit 8fbf9f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

remotecontrol/render.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,12 @@ class RemoteControl {
185185
}
186186
case EVENTS.keydown:
187187
case EVENTS.keyup: {
188-
this._robot.keyToggle(
189-
data.key,
190-
KEY_ACTIONS_FROM_EVENT_TYPE[data.type],
191-
data.modifiers);
188+
if (data.key) {
189+
this._robot.keyToggle(
190+
data.key,
191+
KEY_ACTIONS_FROM_EVENT_TYPE[data.type],
192+
data.modifiers);
193+
}
192194
break;
193195
}
194196
case REQUESTS.start: {

0 commit comments

Comments
 (0)