From 1c76870228796a19b07629e5a0f668628536d4ac Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 27 Apr 2025 18:23:13 +0300 Subject: [PATCH] fix gui.template(...) --- res/scripts/stdlib.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 79482c3e..f60242cd 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -228,11 +228,14 @@ function gui.template(name, params) local text = file.read(file.find("layouts/templates/"..name..".xml")) text = text:gsub("%%{([^}]+)}", function(n) local s = params[n] + if s == nil then + return + end if type(s) ~= "string" then return tostring(s) end if #s == 0 then - return + return '' end local e = string.escape(s) return e:sub(2, #e-1)