Skip to content

Commit 73e440b

Browse files
committed
add nil check if boss data isn't available
1 parent c4f0776 commit 73e440b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Display.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ function MPT:UpdateBosses(Start, count, preview)
410410
if splittext then self:ApplyTextSettings(frame["BossSplit"..i], self.BossSplit, splittext, splitcolor) end
411411
end
412412
elseif Start and not self.IsPreview then
413+
self.cmap = self.cmap or C_ChallengeMode.GetActiveChallengeMapID()
413414
self.BossTimes = {}
414415
self.BossNames = {}
415416
local max = select(3, C_Scenario.GetStepInfo())
@@ -468,9 +469,9 @@ function MPT:UpdateBosses(Start, count, preview)
468469
break
469470
end
470471
end
471-
if self.cmap == 227 and num == 3 then name = "Opera Hall" end
472-
name = self:Utf8Sub(name, 1, self.BossName.MaxLength)
473-
if name and name ~= "" then
472+
if self.cmap == 227 and num == 3 then name = "Opera Hall" end
473+
if name and name ~= "" then
474+
name = self:Utf8Sub(name, 1, self.BossName.MaxLength)
474475
local completed = criteria.completed
475476
local defeated = criteria.elapsed
476477
local frame = F["Bosses"..i]

Functions.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ function MPT:UpdateDisplay()
247247
end
248248

249249
function MPT:Utf8Sub(str, startChar, endChar)
250+
if not str then return str end
250251
local startIndex, endIndex = 1, #str
251252
local currentIndex, currentChar = 1, 0
252253

0 commit comments

Comments
 (0)