From: Steinar H. Gunderson Date: Sun, 2 Feb 2014 21:36:43 +0000 (+0100) Subject: Fix a crash bug on reload. X-Git-Tag: 1.0.2~3 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=4c78d4cddfa8f5b9a9d275822237a0b1f8510dd2 Fix a crash bug on reload. This could happen in the case where we reloaded while still waiting for the request from a given client. --- diff --git a/server.cpp b/server.cpp index f508710..ee91ed8 100644 --- a/server.cpp +++ b/server.cpp @@ -482,6 +482,9 @@ sending_data_again: void Server::skip_lost_data(Client *client) { Stream *stream = client->stream; + if (stream == NULL) { + return; + } size_t bytes_to_send = stream->bytes_received - client->stream_pos; if (bytes_to_send > stream->backlog_size) { size_t bytes_lost = bytes_to_send - stream->backlog_size;