Skip to content

Commit

Permalink
chatbox missing channel index safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Aug 3, 2024
1 parent ad531c1 commit 057fc74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/Chatbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,15 @@ function module:RestoreChatHistory()
if senderRealm ~= playerRealm then displayName = displayName .. '-' .. senderRealm end

local chatType = chatTypeMap[entry.event] or 'SYSTEM'
if entry.event == 'CHAT_MSG_CHANNEL' then chatType = 'CHANNEL' .. entry.channelIndex end
if entry.event == 'CHAT_MSG_CHANNEL' and entry.channelIndex then chatType = 'CHANNEL' .. entry.channelIndex end
local info = ChatTypeInfo[chatType]

local messageWithName = ''
local channelInfo = ''
local languageInfo = ''

-- Handle channel names for all chat types
if entry.event == 'CHAT_MSG_CHANNEL' then
if entry.event == 'CHAT_MSG_CHANNEL' and entry.channelIndex then
if module.DB.shortenChannelNames then
channelInfo = string.format('[%d. %s] ', entry.channelIndex, entry.channelBaseName)
else
Expand Down

0 comments on commit 057fc74

Please sign in to comment.