workaround for ox_inventory returning a bool

I think, if ox_inventory checks a stash that doesn't exist yet, it returns a boolean or `nil`

This checks for that and instead returns a table to hopefully stop the scripts from breaking
This commit is contained in:
Jim Shield
2025-05-04 15:21:02 +01:00
parent 3f72a21d75
commit 07c35cd917

View File

@@ -227,7 +227,9 @@ function getStash(stashName)
local stashItems, items = {}, {}
if isStarted(OXInv) then
stashResource = OXInv
stashItems = exports[OXInv]:Inventory(stashName).items
local stash = exports[OXInv]:Inventory(stashName)
-- Add fallback if ox can't find the stash and returns a boolean
stashItems = type(stash) == "table" and stash.items or {}
elseif isStarted(QSInv) then
stashResource = QSInv