From 1fab405409225677be34c43c179dc29b0cb44429 Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 13 Nov 2023 17:19:11 +0000 Subject: [PATCH] =?utf8?q?JAL-4236=20don=E2=80=99t=20look=20for=20headers=20?= =?utf8?q?in=20JalviewJS?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fts/service/uniprot/UniProtFTSRestClient.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 980dac6..f5e98bd 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -227,18 +227,22 @@ public class UniProtFTSRestClient extends FTSRestClient throw new Exception(errorMessage); } - // new Uniprot API is not including a "X-Total-Results" header when there - // are 0 results - List resultsHeaders = clientResponse.getHeaders() - .get("X-Total-Results"); int xTotalResults = 0; if (Platform.isJS()) { xTotalResults = 1; } - else if (resultsHeaders != null && resultsHeaders.size() >= 1) + else { - xTotalResults = Integer.valueOf(resultsHeaders.get(0)); + // new Uniprot API is not including a "X-Total-Results" header when + // there + // are 0 results + List resultsHeaders = clientResponse.getHeaders() + .get("X-Total-Results"); + if (resultsHeaders != null && resultsHeaders.size() >= 1) + { + xTotalResults = Integer.valueOf(resultsHeaders.get(0)); + } } clientResponse = null; client = null; -- 1.7.10.2