Missing part of previous commit.
authorCarl Hetherington <cth@carlh.net>
Mon, 11 Mar 2019 21:05:14 +0000 (21:05 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Mar 2019 21:05:14 +0000 (21:05 +0000)
src/lib/encode_server.cc

index d31760c0d975686757df88acc4469baa897956a2..16c65dba76f6df8d62c3546d9105fea6ea8662a2 100644 (file)
@@ -313,10 +313,12 @@ EncodeServer::broadcast_received ()
        }
 
        boost::mutex::scoped_lock lm (_broadcast.mutex);
-       _broadcast.socket->async_receive_from (
-               boost::asio::buffer (_broadcast.buffer, sizeof (_broadcast.buffer)),
-               _broadcast.send_endpoint, boost::bind (&EncodeServer::broadcast_received, this)
-               );
+       if (_broadcast.socket) {
+               _broadcast.socket->async_receive_from (
+                       boost::asio::buffer (_broadcast.buffer, sizeof (_broadcast.buffer)),
+                       _broadcast.send_endpoint, boost::bind (&EncodeServer::broadcast_received, this)
+                       );
+       }
 }
 
 void