tell if list empty

master
Zemtzov7 2022-08-27 18:41:25 +05:00 committed by GitHub
parent 03010486c8
commit 605727d7ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@ core.register_chatcommand("getinv", {
return true, "Inventories of "..pname..": "..out
end
local list = inv:get_list(ilist)
if not list then return false, "List not exists" end
local isempty = inv:is_empty(ilist)
if not list or isempty == true then return false, "List not exists or empty" end
for _,stack in ipairs(list) do
local descr = stack:get_description()
if descr and descr ~= "" then