diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-02-12 03:13:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-02-12 03:13:01 +0300 |
commit | 0e1d656e85e1bbc80e9e8adcfb2c07a8bc0d4bb8 (patch) | |
tree | 5b537fe44b0753ced7c6f9fd1aa916604c178f2f /src/net/eathena/chatrecv.cpp | |
parent | 8be2905d29db5013bf8a2d9c5c7c7155af77ed49 (diff) | |
download | plus-0e1d656e85e1bbc80e9e8adcfb2c07a8bc0d4bb8.tar.gz plus-0e1d656e85e1bbc80e9e8adcfb2c07a8bc0d4bb8.tar.bz2 plus-0e1d656e85e1bbc80e9e8adcfb2c07a8bc0d4bb8.tar.xz plus-0e1d656e85e1bbc80e9e8adcfb2c07a8bc0d4bb8.zip |
Fix code style. Add missing actorManager null checks.
Diffstat (limited to 'src/net/eathena/chatrecv.cpp')
-rw-r--r-- | src/net/eathena/chatrecv.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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); } } } |