summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chatrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/chatrecv.cpp')
-rw-r--r--src/net/tmwa/chatrecv.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/tmwa/chatrecv.cpp b/src/net/tmwa/chatrecv.cpp
index d0ac861df..afa501004 100644
--- a/src/net/tmwa/chatrecv.cpp
+++ b/src/net/tmwa/chatrecv.cpp
@@ -129,12 +129,15 @@ void ChatRecv::processGmChat(Net::MessageIn &msg)
return;
}
- std::string chatMsg = msg.readRawString(chatMsgLength, "message");
-
- if (localChatTab != nullptr)
+ if (localChatTab != nullptr &&
+ chatWindow != nullptr)
+ {
+ std::string chatMsg = msg.readRawString(chatMsgLength, "message");
+ chatWindow->addGlobalMessage(chatMsg);
+ }
+ else
{
- if (chatWindow != nullptr)
- chatWindow->addGlobalMessage(chatMsg);
+ msg.readRawString(chatMsgLength, "message");
}
BLOCK_END("ChatRecv::processChat")
}