mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -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);
|
const BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->getTorrent(id);
|
||||||
if (!torrent)
|
if (!torrent)
|
||||||
throw APIError(APIErrorType::NotFound);
|
throw APIError(APIErrorType::NotFound);
|
||||||
|
if (!torrent->hasMetadata())
|
||||||
|
return setResult(QJsonArray{});
|
||||||
|
|
||||||
QList<int> fileIndexes;
|
QList<int> fileIndexes;
|
||||||
const auto idxIt = params().constFind(u"indexes"_s);
|
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);
|
QJsonArray fileList = getFiles(torrent, fileIndexes);
|
||||||
if (!fileList.isEmpty())
|
if (!fileList.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue