Merge pull request #115 from YunoHost/fix_string_helper

Fix string helper if string is empty
This commit is contained in:
Alexandre Aubin 2019-02-21 15:25:19 +01:00 committed by GitHub
commit 5bd4de4bfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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