From 77de1e1b433872d3932ac4f853d1bd99873ca9a3 Mon Sep 17 00:00:00 2001 From: arvidn Date: Thu, 12 Jan 2017 18:40:32 -0500 Subject: [PATCH] improve error message in torrent::force_tracker_request precondition error --- src/torrent.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 687c7bfad..0f5a5d027 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -3273,6 +3273,10 @@ namespace libtorrent // issued by libtorrent) void torrent::force_tracker_request(time_point const t, int const tracker_idx) { + TORRENT_ASSERT_PRECOND((tracker_idx >= 0 + && tracker_idx < int(m_trackers.size())) + || tracker_idx == -1); + if (is_paused()) return; if (tracker_idx == -1) { @@ -3284,7 +3288,6 @@ namespace libtorrent } else { - TORRENT_ASSERT(tracker_idx >= 0 && tracker_idx < int(m_trackers.size())); if (tracker_idx < 0 || tracker_idx >= int(m_trackers.size())) return; announce_entry& e = m_trackers[tracker_idx];