fix: Return error on requested unexisting offset instead of defaulting to 0 offset.

This commit is contained in:
Stiliyan Tonev (Bark) 2025-01-17 11:44:09 +02:00
commit 4a669237dd

View file

@ -387,7 +387,7 @@ void TorrentsController::infoAction()
if (offset < 0)
offset = size + offset;
if ((offset >= size) || (offset < 0))
offset = 0;
throw APIError(APIErrorType::Conflict, tr("Offset is out of range"));
// normalize limit
if (limit <= 0)
limit = -1; // unlimited