diff --git a/src/stationapi/Node.hpp b/src/stationapi/Node.hpp index be5235c..08248f8 100644 --- a/src/stationapi/Node.hpp +++ b/src/stationapi/Node.hpp @@ -38,7 +38,7 @@ public: auto remove_iter = std::remove_if(std::begin(clients_), std::end(clients_), [](auto& client) { - return client->GetConnection()->GetStatus() == UdpConnection::cStatusDisconnected; + return client->GetConnection()->GetStatus() == UdpConnection::cStatusDisconnected || client == std::end(clients_); }); if (remove_iter != std::end(clients_)) diff --git a/src/stationchat/ChatAvatarService.cpp b/src/stationchat/ChatAvatarService.cpp index 0de85a3..746dc32 100644 --- a/src/stationchat/ChatAvatarService.cpp +++ b/src/stationchat/ChatAvatarService.cpp @@ -72,6 +72,7 @@ void ChatAvatarService::LoginAvatar(ChatAvatar* avatar) { } void ChatAvatarService::LogoutAvatar(ChatAvatar* avatar) { + if(!avatar->isOnline_) return; avatar->isOnline_ = false; onlineAvatars_.erase(std::remove_if(