Merge pull request #39 from texm/master

Ensure char is valid
This commit is contained in:
vrld 2016-07-06 14:56:11 +02:00 committed by GitHub
commit e64a822de8

View file

@ -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 + utf8.len(char)