From 09048f4a93411d9da54bbaa1a20388b3924888ba Mon Sep 17 00:00:00 2001 From: IonutParau Date: Thu, 29 May 2025 18:40:17 +0200 Subject: [PATCH] fixed big bug --- src/sandbox.lua | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/sandbox.lua b/src/sandbox.lua index e95e9f0..2fd1f99 100644 --- a/src/sandbox.lua +++ b/src/sandbox.lua @@ -142,20 +142,22 @@ libcomponent = { list = function(filter, exact) checkArg(1, filter, "string", "nil") local t = component.list() - if not filter then return t end - local list = {} - for addr, kind in pairs(t) do - if type(exact) == "boolean" and exact then - if kind == filter then - list[addr] = kind - end - elseif rawequal(exact, "pattern") then - if string.match(kind, filter) then - list[addr] = kind - end - else - if string.find(kind, filter, nil, true) then - list[addr] = kind + local list = t + if filter then + list = {} + for addr, kind in pairs(t) do + if type(exact) == "boolean" and exact then + if kind == filter then + list[addr] = kind + end + elseif rawequal(exact, "pattern") then + if string.match(kind, filter) then + list[addr] = kind + end + else + if string.find(kind, filter, nil, true) then + list[addr] = kind + end end end end