diff --git a/src/transport.cpp b/src/transport.cpp index f633b3648f536e01ffd189dbbf1bcbeec3d9f17b..97ec6dc245048c3eb2cb55e04b334e195ee36daa 100644 --- a/src/transport.cpp +++ b/src/transport.cpp @@ -217,7 +217,9 @@ void Component::start() { //Type casting to BoostConnectionServer since onStopped signal is not defined in ConnectionServer //Ideally, onStopped must be defined in ConnectionServer - boost::dynamic_pointer_cast(m_server->getConnectionServer())->onStopped.connect(boost::bind(&Component::handleServerStopped, this, _1)); + if (boost::dynamic_pointer_cast(m_server->getConnectionServer())) { + boost::dynamic_pointer_cast(m_server->getConnectionServer())->onStopped.connect(boost::bind(&Component::handleServerStopped, this, _1)); + } // We're connected right here, because we're in server mode... handleConnected(); @@ -295,6 +297,10 @@ void Component::handlePresence(Swift::Presence::ref presence) { return; } + if (presence->getType() == Presence::Error) { + return; + } + // check if we have this client's capabilities and ask for them if (presence->getType() != Swift::Presence::Unavailable) { boost::shared_ptr capsInfo = presence->getPayload();