From 0e1d656e85e1bbc80e9e8adcfb2c07a8bc0d4bb8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 12 Feb 2018 03:13:01 +0300 Subject: Fix code style. Add missing actorManager null checks. --- src/net/eathena/chatrecv.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/chatrecv.cpp') diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp index 8ffab1efb..eb6892545 100644 --- a/src/net/eathena/chatrecv.cpp +++ b/src/net/eathena/chatrecv.cpp @@ -365,6 +365,8 @@ void ChatRecv::processChatIgnoreList(Net::MessageIn &msg) void ChatRecv::processChatDisplay(Net::MessageIn &msg) { + if (actorManager == nullptr) + return; const int len = msg.readInt16("len") - 17; ChatObject *const obj = new ChatObject; obj->ownerId = msg.readBeingId("owner account id"); @@ -415,6 +417,8 @@ void ChatRecv::processChatRoomJoinAck(Net::MessageIn &msg) void ChatRecv::processChatRoomLeave(Net::MessageIn &msg) { + if (actorManager == nullptr) + return; msg.readInt16("users"); const std::string name = msg.readString(24, "name"); const int status = msg.readUInt8("flag"); // 0 - left, 1 - kicked @@ -608,6 +612,8 @@ void ChatRecv::processChatRoomCreateAck(Net::MessageIn &msg) void ChatRecv::processChatRoomDestroy(Net::MessageIn &msg) { const int chatId = msg.readInt32("chat id"); + if (actorManager == nullptr) + return; actorManager->removeRoom(chatId); } @@ -672,8 +678,10 @@ void ChatRecv::processChatRoomSettings(Net::MessageIn &msg) if (chat->title != title) { chat->title = title; - actorManager->updateRoom(chat); - chatWindow->joinRoom(true); + if (actorManager != nullptr) + actorManager->updateRoom(chat); + if (chatWindow != nullptr) + chatWindow->joinRoom(true); } } } -- cgit v1.2.3-70-g09d2