improve error message in torrent::force_tracker_request precondition error

This commit is contained in:
arvidn 2017-01-12 18:40:32 -05:00 committed by Arvid Norberg
parent 4f7b69be90
commit 77de1e1b43
1 changed files with 4 additions and 1 deletions

View File

@ -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];