From 83eb75ad7a443c104352fe12c78c2f76ccef7061 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 21 Jan 2019 21:41:46 +0100 Subject: [PATCH] keyboard: Fix JS warning Iterate correctly through the array, instead of stepping on the possibly non existent first element. --- js/ui/keyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index a37580b32..b1fafb953 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -860,7 +860,7 @@ var Keyboard = class Keyboard { } _setCurrentLevelLatched(layout, latched) { - for (let i = 0; layout.shiftKeys[i]; i++) { + for (let i = 0; i < layout.shiftKeys.length; i++) { let key = layout.shiftKeys[i]; key.setLatched(latched); }