Return empty list instead of error.

This commit is contained in:
Stiliyan Tonev (Bark) 2025-01-27 14:24:36 +02:00
commit 876849cdc1

View file

@ -386,8 +386,10 @@ void TorrentsController::infoAction()
// normalize offset // normalize offset
if (offset < 0) if (offset < 0)
offset = size + offset; offset = size + offset;
if ((offset >= size) || (offset < 0)) if ((offset >= size) || (offset < 0)) {
throw APIError(APIErrorType::Conflict, tr("Offset is out of range")); setResult(QJsonArray {});
return;
}
// normalize limit // normalize limit
if (limit <= 0) if (limit <= 0)
limit = -1; // unlimited limit = -1; // unlimited