SOLR-1160: possible null pointer exception path

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@774765 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-05-14 13:41:52 +00:00
parent e14e521c11
commit 95e42190cf
1 changed files with 8 additions and 4 deletions

View File

@ -130,10 +130,14 @@ public abstract class RequestHandlerBase implements SolrRequestHandler, SolrInfo
rsp.setHttpCaching(httpCaching);
handleRequestBody( req, rsp );
// count timeouts
boolean timedOut = (Boolean)rsp.getResponseHeader().get("partialResults") == null ? false : (Boolean)rsp.getResponseHeader().get("partialResults");
if( timedOut ) {
numTimeouts++;
rsp.setHttpCaching(false);
NamedList header = rsp.getResponseHeader();
if(header != null) {
Object partialResults = header.get("partialResults");
boolean timedOut = partialResults == null ? false : (Boolean)partialResults;
if( timedOut ) {
numTimeouts++;
rsp.setHttpCaching(false);
}
}
} catch (Exception e) {
SolrException.log(SolrCore.log,e);