Skip to content

Commit

Permalink
fix a coredump in TorrentTracker (fix #513)
Browse files Browse the repository at this point in the history
  • Loading branch information
lavv17 committed Nov 28, 2020
1 parent 11482e5 commit d67fc14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TorrentTracker.cc
Expand Up @@ -121,7 +121,7 @@ bool TorrentTracker::AddPeer(const xstring& addr,int port) const
int TorrentTracker::Do()
{
int m=STALL;
if(Failed())
if(Failed() || !backend)
return m;
if(backend && backend->IsActive()) {
if(tracker_timeout_timer.Stopped()) {
Expand Down Expand Up @@ -165,6 +165,8 @@ void TorrentTracker::Start()
}
void TorrentTracker::SendTrackerRequest(const char *event)
{
if(!backend)
return;
backend->SendTrackerRequest(event);
tracker_timeout_timer.Reset();
}
Expand Down

0 comments on commit d67fc14

Please sign in to comment.