From 07c35cd917407a554c9272556f5ddc0b728e6fd0 Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Sun, 4 May 2025 15:21:02 +0100 Subject: [PATCH] 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 --- shared/stashcontrol.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/stashcontrol.lua b/shared/stashcontrol.lua index 71895a3..a9da2ec 100644 --- a/shared/stashcontrol.lua +++ b/shared/stashcontrol.lua @@ -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