You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2026. It is now read-only.
Getting a nil value error when syncInventory is called during server restart/shutdown period.
Error Message
@ox_inventory/modules/bridge/esx/server.lua:56: attempt to index a nil value (local 'player')
Steps to Reproduce
Wait until server restart is approaching (1-5 minutes before restart)
Trigger inventory save operation (e.g., /saveinv command)
Error is thrown in console
local accounts = Inventory.GetAccountItemCounts(inv)
if accounts then
local player = server.GetPlayerFromId(inv.id)
player.syncInventory(inv.weight, inv.maxWeight, inv.items, accounts)
-- ^ Error occurs here when player is nil
end
end```
<img width="1233" height="94" alt="Image" src="https://github.com/user-attachments/assets/e925fe85-df4d-47c7-a260-8a99f6975810" />
Getting a nil value error when syncInventory is called during server restart/shutdown period.
Error Message
@ox_inventory/modules/bridge/esx/server.lua:56: attempt to index a nil value (local 'player')
Steps to Reproduce
Wait until server restart is approaching (1-5 minutes before restart)
Trigger inventory save operation (e.g., /saveinv command)
Error is thrown in console
Framework: ESX
Code Location
File: ox_inventory/modules/bridge/esx/server.lua
Line: 56