mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-24 05:25:37 +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::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…
x
Reference in New Issue
Block a user