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 d31760c..16c65db 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