Quantcast

V0.4.1

Brandon Talbot [07-09-16 - 21:01]
V0.4.1

* Fix potential crash when using items
Filename
DJBags.toc
src/lua/controllers/bag.lua
diff --git a/DJBags.toc b/DJBags.toc
index 650bccd..3c96d7e 100644
--- a/DJBags.toc
+++ b/DJBags.toc
@@ -2,7 +2,7 @@
 ## Title: DJBags
 ## Author: DarkJaguar91
 ## Notes: BagAddon - BETA
-## Version: 0.3.1
+## Version: 0.4.1
 ## SavedVariables: DJBagsConfig

 src/manifest.xml
\ No newline at end of file
diff --git a/src/lua/controllers/bag.lua b/src/lua/controllers/bag.lua
index 246bcba..5449ace 100644
--- a/src/lua/controllers/bag.lua
+++ b/src/lua/controllers/bag.lua
@@ -148,10 +148,12 @@ function bag:BAG_UPDATE_COOLDOWN()
 end

 function bag:ITEM_LOCK_CHANGED(bag, slot)
-    if bag >= 0 and bag <= NUM_BAG_SLOTS then
-        ADDON.cache:GetItem(bag, slot):UpdateLock()
+    if bag then
+        if bag >= 0 and bag <= NUM_BAG_SLOTS and slot then
+            ADDON.cache:GetItem(bag, slot):UpdateLock()
+        end
+        self.frame.bagBar:UpdateLock(bag)
     end
-    self.frame.bagBar:UpdateLock(bag)
 end

 function bag:BAG_UPDATE_DELAYED()