From: Alexander Yakushev Date: Tue, 30 Nov 2010 05:32:37 +0000 (+0200) Subject: Added a gag to prevent crashes on parsing errors X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=0e0b19c905d58f6795a57f8042a958a76dec7f60;p=awesompd.git Added a gag to prevent crashes on parsing errors --- diff --git a/utf8.lua b/utf8.lua index 3db6642..72177c2 100644 --- a/utf8.lua +++ b/utf8.lua @@ -100,6 +100,10 @@ end -- instead of bytes function utf8sub (s, i, j) j = j or -1 + + if i == nil then + return "" + end local pos = 1 local bytes = string.len(s)