Skip to content

Commit 0bd7d7a

Browse files
committed
Update Item.lua
Fix a missed null/zero check before calling an API method
1 parent 7f31b83 commit 0bd7d7a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: System/Functions/Item.lua

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function br.canUseItem(itemID)
1414
end
1515
if itemID <= 19 then
1616
local slotItemID = br._G.GetInventoryItemID("player", itemID)
17+
if slotItemID == nil or slotItemID==0 then
18+
return false
19+
end
1720
if br._G.GetItemSpell(slotItemID) ~= nil then
1821
if br._G.GetItemCooldown(slotItemID) == 0 and br._G.IsUsableItem(slotItemID) then
1922
return true

0 commit comments

Comments
 (0)