mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
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:
@@ -227,7 +227,9 @@ function getStash(stashName)
|
|||||||
local stashItems, items = {}, {}
|
local stashItems, items = {}, {}
|
||||||
if isStarted(OXInv) then
|
if isStarted(OXInv) then
|
||||||
stashResource = OXInv
|
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
|
elseif isStarted(QSInv) then
|
||||||
stashResource = QSInv
|
stashResource = QSInv
|
||||||
|
|||||||
Reference in New Issue
Block a user