diff --git a/src/session_impl.cpp b/src/session_impl.cpp index b975e0583..c734d3913 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2246,6 +2246,8 @@ namespace aux { m_dht_announce_timer.async_wait( bind(&session_impl::on_dht_announce, this, _1)); + if (m_torrents.empty()) return; + if (m_next_dht_torrent == m_torrents.end()) m_next_dht_torrent = m_torrents.begin(); m_next_dht_torrent->second->dht_announce(); @@ -2270,6 +2272,8 @@ namespace aux { m_lsd_announce_timer.async_wait( bind(&session_impl::on_lsd_announce, this, _1)); + if (m_torrents.empty()) return; + if (m_next_lsd_torrent == m_torrents.end()) m_next_lsd_torrent = m_torrents.begin(); m_next_lsd_torrent->second->lsd_announce();