From 1b374b41cf443a5171a06f5715408d64e14e20ae Mon Sep 17 00:00:00 2001 From: tex Date: Sun, 3 Jul 2016 20:29:09 +0800 Subject: [PATCH] Ensure char is valid Fixes an error which could occur if an input's state was set to active without user interaction --- input.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.lua b/input.lua index e08ff0d..3a56688 100644 --- a/input.lua +++ b/input.lua @@ -55,7 +55,7 @@ return function(core, input, ...) if opt.hasKeyboardFocus then local keycode,char = core:getPressedKey() -- text input - if char ~= "" then + if char and char ~= "" then local a,b = split(input.text, input.cursor) input.text = table.concat{a, char, b} input.cursor = input.cursor + 1