errors with qbox
Describe the bug
12:48:55 PM [ script:ox_inventory] SCRIPT ERROR: @ox_inventory/modules/inventory/server.lua:926: attempt to compare number with nil
12:48:55 PM [ script:ox_inventory] > new StackDumpError (@oxmysql/citizen:/scripting/v8/main.js:405)
12:48:55 PM [ script:ox_inventory] >
Framework qbox
Resource version version '2.44.1'
To Reproduce open inventory and load into the server
Expected behavior No error
Screenshots If applicable, add screenshots to help explain your problem.
the line and area around it...
---@param inv inventory ---@param item table | string ---@param count number ---@param metadata? table function Inventory.SetItem(inv, item, count, metadata) if type(item) ~= 'table' then item = Items(item) end
if item and count >= 0 then
inv = Inventory(inv) --[[@as OxInventory]]
if inv then
inv.changed = true
local itemCount = Inventory.GetItem(inv, item.name, metadata, true) --[[@as number]]
if count > itemCount then
count -= itemCount
return Inventory.AddItem(inv, item.name, count, metadata)
elseif count <= itemCount then
itemCount -= count
return Inventory.RemoveItem(inv, item.name, itemCount, metadata)
end
end
end
end exports('SetItem', Inventory.SetItem)
Please provide steps to Reproduce this issue