From febc3b165956b43c3e7384c3c1822ffaaa6fdbfe Mon Sep 17 00:00:00 2001 From: Michael Meister Date: Fri, 19 Jan 2024 19:29:49 +0100 Subject: [PATCH] tools/script_manager - fixed crash The script manager crashes if a LUA script was not copied to a subfolder but directly into the LUA directory. The reason is that the regular expression, which among other things extracts the category of the script from its file path, does not match and thus the category is null. To prevent this, a null check has been added. --- tools/script_manager.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 74697d5..7376ed4 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -497,14 +497,15 @@ local function process_script_data(script_file) -- add the script data local category,path,name,filename,filetype = string.match(script_file, pattern) - log.msg(log.debug, "category is " .. category) - log.msg(log.debug, "name is " .. name) - add_script_category(category) + if category and name and path then + log.msg(log.debug, "category is " .. category) + log.msg(log.debug, "name is " .. name) - if name then + add_script_category(category) add_script_name(name, path, category) end + restore_log_level(old_log_level) end