X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=server.cpp;h=9517b5480e5f55ce6c5decee9ab6ad726edf3167;hb=807a8ae8f6aca56e3e809aa19f4034a323f1b987;hp=949d6a4d6958eff742c6c75783ed18f48d7f49c2;hpb=1071b76d8e60d51d88d4e1310e7d6261b628a454;p=cubemap diff --git a/server.cpp b/server.cpp index 949d6a4..9517b54 100644 --- a/server.cpp +++ b/server.cpp @@ -153,7 +153,13 @@ void Server::add_client(int sock) void Server::add_client_from_serialized(const ClientProto &client) { MutexLock lock(&mutex); - Stream *stream = find_stream(client.stream_id()); + Stream *stream; + map::iterator stream_it = streams.find(client.stream_id()); + if (stream_it == streams.end()) { + stream = NULL; + } else { + stream = stream_it->second; + } clients.insert(make_pair(client.sock(), Client(client, stream))); Client *client_ptr = &clients[client.sock()];