datacollection line 471 crash solved - bagSlot should never get this far as number, but now it's converted back to table so rest of code is happy

AssemblerManiac [02-28-18 - 15:37]
datacollection line 471 crash solved - bagSlot should never get this far as number, but now it's converted back to table so rest of code is happy
Filename
IIfA/IIfADataCollection.lua
diff --git a/IIfA/IIfADataCollection.lua b/IIfA/IIfADataCollection.lua
index dcc296c..b737b23 100644
--- a/IIfA/IIfADataCollection.lua
+++ b/IIfA/IIfADataCollection.lua
@@ -471,6 +471,13 @@ function IIfA:EvalBagItem(bagId, slotId, fromXfer, qty, itemLink, itemName, loca
 		else
 p(DBitem.locations[location])
 			if DBitem.locations[location] then
+				if type(DBitem.locations[location].bagSlot) ~= "table" then
+					local bagSlot
+					bagSlot = data.bagSlot
+					DBitem.locations[location].bagSlot = {}
+					DBitem.locations[location].bagSlot[bagSlot] = DBitem.locations[location].itemCount
+					DBitem.locations[location].itemCount = nil
+				end
 				if DBitem.locations[location].bagSlot[slotId] then
 p("Adding to slot " .. slotId)
 					DBitem.locations[location].bagSlot[slotId] = DBitem.locations[location].bagSlot[slotId] + itemCount