From ff060781b6afcb063638ca6146427c1c815445a7 Mon Sep 17 00:00:00 2001 From: greenya Date: Sun, 19 Nov 2017 13:25:13 +0200 Subject: [PATCH] panel: fix division by zero in exp display --- modules/panel.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/panel.lua b/modules/panel.lua index 03868fec..5c319eeb 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -220,8 +220,12 @@ pfUI:RegisterModule("panel", function () if oldexp ~= nil then difexp = curexp - oldexp maxexp = UnitXPMax("player") - remexp = floor((maxexp - curexp)/difexp) - remstring = "|cff555555 [" .. remexp .. "]|r" + if difexp > 0 then + remexp = floor((maxexp - curexp)/difexp) + remstring = "|cff555555 [" .. remexp .. "]|r" + else + remstring = nil + end end oldexp = curexp