mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 06:17:58 +00:00
Guard against potential negative number
This commit is contained in:
parent
b35c2bca5d
commit
6c16a09385
@ -151,8 +151,8 @@ public:
|
||||
? BitTorrent::TorrentContentLayout::NoSubfolder
|
||||
: BitTorrent::TorrentContentLayout::Subfolder);
|
||||
|
||||
if (!m_filePriorities.isEmpty())
|
||||
m_filePriorities.resize(filesCount(), BitTorrent::DownloadPriority::Normal);
|
||||
if (const int fileCount = filesCount(); !m_filePriorities.isEmpty() && (fileCount >= 0))
|
||||
m_filePriorities.resize(fileCount, BitTorrent::DownloadPriority::Normal);
|
||||
}
|
||||
|
||||
bool hasMetadata() const override
|
||||
|
Loading…
Reference in New Issue
Block a user