handled missing text in textual replacements

This commit is contained in:
Sokomine 2022-05-06 15:06:01 +02:00
parent 9fadc666ae
commit 47f9c83358

View File

@ -38,7 +38,7 @@ yl_speak_up.replace_vars_in_text = function(text, dialog, pname)
-- substitutions in it using substring captured by "()" in
-- pattern. "[%a_]+" means one or more letter or underscore.
-- If lookup returns nil, then no substitution is made.
text = string.gsub(text, "%$([%a_]+)%$", subs)
text = string.gsub(text or "", "%$([%a_]+)%$", subs)
return text
end