mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Guard against potential negative number
This commit is contained in:
parent
b35c2bca5d
commit
6c16a09385
1 changed files with 2 additions and 2 deletions
|
@ -151,8 +151,8 @@ public:
|
||||||
? BitTorrent::TorrentContentLayout::NoSubfolder
|
? BitTorrent::TorrentContentLayout::NoSubfolder
|
||||||
: BitTorrent::TorrentContentLayout::Subfolder);
|
: BitTorrent::TorrentContentLayout::Subfolder);
|
||||||
|
|
||||||
if (!m_filePriorities.isEmpty())
|
if (const int fileCount = filesCount(); !m_filePriorities.isEmpty() && (fileCount >= 0))
|
||||||
m_filePriorities.resize(filesCount(), BitTorrent::DownloadPriority::Normal);
|
m_filePriorities.resize(fileCount, BitTorrent::DownloadPriority::Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasMetadata() const override
|
bool hasMetadata() const override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue