fix: handle empty or missing delimiters in HealBot_SplitString to prevent errors

This commit is contained in:
Bluewhale1337
2026-08-07 14:43:18 +02:00
parent 327cd7a08c
commit d5dec0f1f0
+3
View File
@@ -123,6 +123,9 @@ end
function HealBot_SplitString(str, delimiter) function HealBot_SplitString(str, delimiter)
local result = {} local result = {}
if not delimiter or delimiter == "" then
return {str}
end
local start_pos = 1 local start_pos = 1
while true do while true do
local end_pos = string.find(str, delimiter, start_pos, true) local end_pos = string.find(str, delimiter, start_pos, true)