diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 11b192d1e..7d44747a6 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1577,7 +1577,8 @@ namespace libtorrent if (!m_ses.settings().close_redundant_connections) return; boost::shared_ptr t = m_torrent.lock(); - TORRENT_ASSERT(t); + if (!t) return; + if (m_upload_only && t->is_finished()) { disconnect(error_code(errors::upload_upload_connection, libtorrent_category));