From 62183de78ca0fb9361a0c601b683d0361d00b72b Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 20 Jun 2023 20:01:22 +0200 Subject: [PATCH] Make skooma loaders fail when no file is found --- glass/skooma/html.lua | 5 ++++- glass/skooma/xml.lua | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/glass/skooma/html.lua b/glass/skooma/html.lua index 626ec5b..8d35a2c 100644 --- a/glass/skooma/html.lua +++ b/glass/skooma/html.lua @@ -17,7 +17,10 @@ end}) -- @function load return function(name) name = tostring(name)..'.html.skooma' - local template = loadfile(name, "t", env) + local template, err = loadfile(name, "t", env) + if template == nil then + return nil, err + end if setfenv then setfenv(template, env) end diff --git a/glass/skooma/xml.lua b/glass/skooma/xml.lua index 78bbc4d..6c0a6b6 100644 --- a/glass/skooma/xml.lua +++ b/glass/skooma/xml.lua @@ -17,7 +17,10 @@ end}) -- @function load return function(name) name = tostring(name)..'.xml.skooma' - local template = loadfile(name, "t", env) + local template, err = loadfile(name, "t", env) + if template == nil then + return nil, err + end if setfenv then setfenv(template, env) end