From 7f54a7c94ebd42e68e4311184e9340e08efea02d Mon Sep 17 00:00:00 2001 From: William Au Date: Tue, 11 Sep 2007 14:18:03 +0000 Subject: [PATCH] SOLR-335: work-around in lieu of PingRequestHandler git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@574605 13f79535-47bb-0310-9956-ffa450edef68 --- .../client/solrj/response/SolrResponseBase.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java b/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java index 834c8c71389..b6dda7b3837 100644 --- a/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java +++ b/client/java/solrj/src/org/apache/solr/client/solrj/response/SolrResponseBase.java @@ -63,11 +63,23 @@ public abstract class SolrResponseBase implements SolrResponse // these two methods are based on the logic in SolrCore.setResponseHeaderValues(...) public int getStatus() { - return (Integer) getResponseHeader().get("status"); + NamedList header = getResponseHeader(); + if (header != null) { + return (Integer) header.get("status"); + } + else { + return 0; + } } public int getQTime() { - return (Integer) getResponseHeader().get("QTime"); + NamedList header = getResponseHeader(); + if (header != null) { + return (Integer) header.get("QTime"); + } + else { + return 0; + } } public String getRequestUrl() {