From 36be0520dbecdef846ea6600ee30980513c54023 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 13 Feb 2022 15:57:54 -0800 Subject: [PATCH] Fixed crash on chat message --- src/pc/djui/djui_chat_message.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pc/djui/djui_chat_message.c b/src/pc/djui/djui_chat_message.c index 92ace035..5d131bd7 100644 --- a/src/pc/djui/djui_chat_message.c +++ b/src/pc/djui/djui_chat_message.c @@ -5,6 +5,7 @@ #include "audio/external.h" #include "game/mario_misc.h" #include "djui.h" +#include "pc/debuglog.h" #define DJUI_CHAT_LIFE_TIME 10.0f @@ -45,6 +46,10 @@ static void djui_chat_message_destroy(struct DjuiBase* base) { void djui_chat_message_create_from(u8 globalIndex, const char* message) { struct NetworkPlayer* np = network_player_from_global_index(globalIndex); + if (np == NULL) { + LOG_ERROR("Could not find network player, global index: %u", globalIndex); + return; + } char* playerColorString = network_get_player_text_color_string(np->localIndex); char chatMsg[256] = { 0 };