Quantcast

Removed more nil-errors

Kibsgaard [12-22-13 - 22:32]
Removed more nil-errors
Tagging as v0.1.6

Signed-off-by: Kibsgaard <http://www.curseforge.com/profiles/Kibsgaard/>
Filename
KibsItemLevel.lua
KibsItemLevel.toc
diff --git a/KibsItemLevel.lua b/KibsItemLevel.lua
index 11a4e63..f36e7df 100644
--- a/KibsItemLevel.lua
+++ b/KibsItemLevel.lua
@@ -93,9 +93,11 @@ end
 function eventHandler(self,event,...)
 	if(KibsItemLevelConfig.on)then
 		if (event == "INSPECT_READY" and KibsItemLevelConfig.Inspection) then
-			findItemInfo(InspectFrame.unit);
-			KIL_wait(1.5,findItemInfo,InspectFrame.unit);
-			KIL_wait(3,findItemInfo,InspectFrame.unit);
+			if(InspectFrame.unit)then
+				findItemInfo(InspectFrame.unit);
+				KIL_wait(1.5,findItemInfo,InspectFrame.unit);
+				KIL_wait(3,findItemInfo,InspectFrame.unit);
+			end
 		elseif(KibsItemLevelConfig.Character) then
 			findItemInfo("player");
 		end
@@ -219,15 +221,16 @@ function findItemInfo(who)
 			local enchantInfo;
 			if (itemlink) then
 				local upgrade, max, delta = ItemUpgradeInfo:GetItemUpgradeInfo(itemlink)
-				local ilvl = 0;
-				ilvl = ItemUpgradeInfo:GetUpgradedItemLevel(itemlink)
+				local ilvl = ItemUpgradeInfo:GetUpgradedItemLevel(itemlink)
 				if (upgrade and KibsItemLevelConfig.upgrades) then
 					ActiveFontStrings[i]:SetText(ilvl .." ("..upgrade.."/"..max..")")
 				else
 					ActiveFontStrings[i]:SetText(ilvl)
 				end
 				findSockets(who,i,slotID);
-				tilvl = tilvl + ilvl;
+				if(ilvl)then
+					tilvl = tilvl + ilvl;
+				end
 				numItems = numItems + 1;
 				local line = "";
 				GameTooltip:SetOwner(ilvlFrame,"CENTER");
@@ -275,7 +278,7 @@ function findItemInfo(who)
 end

 function findSockets(who,slot,slotID)
-
+
 	local itemLink = GetInventoryItemLink(who,slot);
 	local _, _, Color, Ltype, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")

diff --git a/KibsItemLevel.toc b/KibsItemLevel.toc
index 104eeb8..a778c8e 100644
--- a/KibsItemLevel.toc
+++ b/KibsItemLevel.toc
@@ -1,5 +1,5 @@
 ## Interface: 50400
-## Version: 0.1.5
+## Version: 0.1.6
 ## Title: KibsItemLevel
 ## Author: Kibs
 ## SavedVariables: KibsItemLevelConfig