throw new Exception(errorMessage);
}
- // new Uniprot API is not including a "X-Total-Results" header when there
- // are 0 results
- List<String> 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<String> resultsHeaders = clientResponse.getHeaders()
+ .get("X-Total-Results");
+ if (resultsHeaders != null && resultsHeaders.size() >= 1)
+ {
+ xTotalResults = Integer.valueOf(resultsHeaders.get(0));
+ }
}
clientResponse = null;
client = null;