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.
This commit is contained in:
Michael Meister
2024-01-19 19:29:49 +01:00
parent 9fdd69556c
commit febc3b1659

View File

@@ -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