Skip to content

Commit d32ad43

Browse files
committed
Fix crash caused by pre-2.6 IC packet
1 parent 679dcca commit d32ad43

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/courtroom.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,13 @@ void Courtroom::chatmessage_enqueue(QStringList p_contents)
19411941
// Record the log I/O, log files should be accurate.
19421942
// If desynced logs are on, display the log IC immediately.
19431943
LogMode log_mode = ao_app->is_desyncrhonized_logs_enabled() ? DISPLAY_AND_IO : IO_ONLY;
1944-
log_chatmessage(p_contents[MESSAGE], f_char_id, p_contents[SHOWNAME], p_contents[TEXT_COLOR].toInt(), log_mode);
1944+
1945+
// Use null showname if packet does not support 2.6+ extensions
1946+
QString showname = QString();
1947+
if (SHOWNAME < p_contents.size())
1948+
showname = p_contents[SHOWNAME];
1949+
1950+
log_chatmessage(p_contents[MESSAGE], f_char_id, showname, p_contents[TEXT_COLOR].toInt(), log_mode);
19451951
// Send this boi into the queue
19461952
chatmessage_queue.enqueue(p_contents);
19471953

0 commit comments

Comments
 (0)