From: James Procter Date: Mon, 13 Nov 2023 17:19:11 +0000 (+0000) Subject: JAL-4236 don’t look for headers in JalviewJS X-Git-Tag: Release_2_11_4_0~88 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1fab405409225677be34c43c179dc29b0cb44429;p=jalview.git JAL-4236 don’t look for headers in JalviewJS --- 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;