From: Gunnar Beutner Date: Wed, 11 Sep 2013 07:44:23 +0000 (+0200) Subject: Fix crash in Endpoint::MessageThreadProc. X-Git-Tag: v0.0.3~563 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=551f06c744fea5b94211c0a61cdc69ef4d7a44c6;p=icinga2 Fix crash in Endpoint::MessageThreadProc. --- diff --git a/components/cluster/endpoint.cpp b/components/cluster/endpoint.cpp index e9ab41e55..efb08e847 100644 --- a/components/cluster/endpoint.cpp +++ b/components/cluster/endpoint.cpp @@ -59,10 +59,12 @@ void Endpoint::SetClient(const Stream::Ptr& client) m_Client = client; } - boost::thread thread(boost::bind(&Endpoint::MessageThreadProc, this, client)); - thread.detach(); + if (client) { + boost::thread thread(boost::bind(&Endpoint::MessageThreadProc, this, client)); + thread.detach(); - OnConnected(GetSelf()); + OnConnected(GetSelf()); + } } void Endpoint::SendMessage(const Dictionary::Ptr& message)