From cddbfca31bdc986a3d658d955bd7d3b25200bf3b Mon Sep 17 00:00:00 2001 From: MilleXIV Date: Sun, 28 Aug 2016 18:26:52 -0400 Subject: [PATCH] Fixing error Caused by trying to update in combat, wasn't checking if the xpText was even being used --- modules/currency.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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') -- 1.7.9.5