From 4a669237dd13203568710dc10d30aa23df6fc014 Mon Sep 17 00:00:00 2001 From: "Stiliyan Tonev (Bark)" Date: Fri, 17 Jan 2025 11:44:09 +0200 Subject: [PATCH] fix: Return error on requested unexisting offset instead of defaulting to 0 offset. --- src/webui/api/torrentscontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index dcf9580b6..1323633f2 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -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