Skip to content

Commit

Permalink
fix(client/qb): nil item amount (#130)
Browse files Browse the repository at this point in the history
I assume non-existent items?
  • Loading branch information
tomigatica15 committed Mar 1, 2024
1 parent b0a2325 commit bba746c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/framework/qb.lua
Expand Up @@ -9,12 +9,12 @@ local utils = require 'client.utils'
local playerItems = utils.getItems()

local function setPlayerItems()
if not playerData?.items then return end
if not playerData or not playerData.items then return end

table.wipe(playerItems)

for _, item in pairs(playerData.items) do
playerItems[item.name] = (playerItems[item.name] or 0) + item.amount
playerItems[item.name] = (playerItems[item.name] or 0) + (item.amount or 0)
end
end

Expand Down

0 comments on commit bba746c

Please sign in to comment.