From 441f323094e804288f9293bd4c41290b89a34a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 23 Jan 2019 10:22:02 +0100 Subject: [PATCH] Fix string helper if string is empty --- helpers.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpers.lua b/helpers.lua index c53e783..3fc4d96 100644 --- a/helpers.lua +++ b/helpers.lua @@ -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