Browse Source

Don't make assertion about 3rd party logic

PR #18913.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
5a1dcbae9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/base/bittorrent/torrentimpl.cpp

8
src/base/bittorrent/torrentimpl.cpp

@ -777,7 +777,13 @@ qreal TorrentImpl::progress() const
return 1.; return 1.;
const qreal progress = static_cast<qreal>(m_nativeStatus.total_wanted_done) / m_nativeStatus.total_wanted; const qreal progress = static_cast<qreal>(m_nativeStatus.total_wanted_done) / m_nativeStatus.total_wanted;
Q_ASSERT((progress >= 0.f) && (progress <= 1.f)); if ((progress < 0.f) || (progress > 1.f))
{
LogMsg(tr("Unexpected data detected. Torrent: %1. Data: total_wanted=%2 total_wanted_done=%3.")
.arg(name(), QString::number(m_nativeStatus.total_wanted), QString::number(m_nativeStatus.total_wanted_done))
, Log::WARNING);
}
return progress; return progress;
} }

Loading…
Cancel
Save