Fix string helper if string is empty

This commit is contained in:
Josué Tille 2019-01-23 10:22:02 +01:00
parent e7a131063e
commit 441f323094
No known key found for this signature in database
GPG key ID: D5E068C6DFA8681D

View file

@ -38,7 +38,10 @@ end
-- Test whether a string starts with another
function string.starts(String, Start)
return string.sub(String, 1, string.len(Start)) == Start
if not String then
return false
end
return string.sub(String, 1, string.len(Start)) == Start
end