Quantcast

Fixing error

MilleXIV [08-28-16 - 22:26]
Fixing error

Caused by trying to update in combat, wasn't checking if the xpText was
even being used
Filename
modules/currency.lua
diff --git a/modules/currency.lua b/modules/currency.lua
index 81c7063..2d3cc10 100644
--- a/modules/currency.lua
+++ b/modules/currency.lua
@@ -53,9 +53,11 @@ function CurrencyModule:Refresh()

   xb.constants.playerLevel = UnitLevel("player")
   if InCombatLockdown() then
-    self.xpBar:SetMinMaxValues(0, UnitXPMax('player'))
-    self.xpBar:SetValue(UnitXP('player'))
-    self.xpText:SetText(string.upper(LEVEL..' '..UnitLevel("player")..' '..UnitClass('player')))
+    if xb.constants.playerLevel < MAX_PLAYER_LEVEL and db.modules.currency.showXPbar then
+      self.xpBar:SetMinMaxValues(0, UnitXPMax('player'))
+      self.xpBar:SetValue(UnitXP('player'))
+      self.xpText:SetText(string.upper(LEVEL..' '..UnitLevel("player")..' '..UnitClass('player')))
+    end
     self:RegisterEvent('PLAYER_REGEN_ENABLED', function()
       self:Refresh()
       self:UnregisterEvent('PLAYER_REGEN_ENABLED')