From 876849cdc10faa7d6e5f7b4e009f6ebcfeb85602 Mon Sep 17 00:00:00 2001 From: "Stiliyan Tonev (Bark)" Date: Mon, 27 Jan 2025 14:24:36 +0200 Subject: [PATCH] Return empty list instead of error. --- src/webui/api/torrentscontroller.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 1323633f2..4e7bc5094 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -386,8 +386,10 @@ void TorrentsController::infoAction() // normalize offset if (offset < 0) offset = size + offset; - if ((offset >= size) || (offset < 0)) - throw APIError(APIErrorType::Conflict, tr("Offset is out of range")); + if ((offset >= size) || (offset < 0)) { + setResult(QJsonArray {}); + return; + } // normalize limit if (limit <= 0) limit = -1; // unlimited