mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
fix: early return for missing metadata
This commit is contained in:
parent
0a908f93ce
commit
7b268614e1
1 changed files with 2 additions and 3 deletions
|
@ -744,6 +744,8 @@ void TorrentsController::filesAction()
|
|||
const BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->getTorrent(id);
|
||||
if (!torrent)
|
||||
throw APIError(APIErrorType::NotFound);
|
||||
if (!torrent->hasMetadata())
|
||||
return setResult(QJsonArray{});
|
||||
|
||||
QList<int> fileIndexes;
|
||||
const auto idxIt = params().constFind(u"indexes"_s);
|
||||
|
@ -765,9 +767,6 @@ void TorrentsController::filesAction()
|
|||
});
|
||||
}
|
||||
|
||||
if (!torrent->hasMetadata())
|
||||
return setResult(QJsonArray {});
|
||||
|
||||
QJsonArray fileList = getFiles(torrent, fileIndexes);
|
||||
if (!fileList.isEmpty())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue