diff --git a/custrom_functions_you_can_override.lua b/custrom_functions_you_can_override.lua index 52b23e6..f4e2153 100644 --- a/custrom_functions_you_can_override.lua +++ b/custrom_functions_you_can_override.lua @@ -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