From cb54e164ffdd30e10c51d88de44498fff490589e Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 1 Oct 2019 20:07:39 +0200 Subject: [PATCH] xpbar: avoid nil error when reaching maxlevel --- modules/xpbar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/xpbar.lua b/modules/xpbar.lua index 49d53719..c7b434f0 100644 --- a/modules/xpbar.lua +++ b/modules/xpbar.lua @@ -83,7 +83,7 @@ pfUI:RegisterModule("xpbar", "vanilla:tbc", function () this.enabled = true if event == "PLAYER_ENTERING_WORLD" then this.starttime = GetTime() - this.startxp = UnitXP("player") + this.startxp = UnitXP("player") or 0 elseif event == "PLAYER_LEVEL_UP" then -- add previously gained experience to the session this.startxp = this.startxp - UnitXPMax("player")