fixed big bug

This commit is contained in:
IonutParau 2025-05-29 18:40:17 +02:00
parent e9de55dbc2
commit 09048f4a93

View File

@ -142,8 +142,9 @@ libcomponent = {
list = function(filter, exact) list = function(filter, exact)
checkArg(1, filter, "string", "nil") checkArg(1, filter, "string", "nil")
local t = component.list() local t = component.list()
if not filter then return t end local list = t
local list = {} if filter then
list = {}
for addr, kind in pairs(t) do for addr, kind in pairs(t) do
if type(exact) == "boolean" and exact then if type(exact) == "boolean" and exact then
if kind == filter then if kind == filter then
@ -159,6 +160,7 @@ libcomponent = {
end end
end end
end end
end
local key = nil local key = nil
return setmetatable(list, { return setmetatable(list, {