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); rsp.setHttpCaching(httpCaching);
handleRequestBody( req, rsp ); handleRequestBody( req, rsp );
// count timeouts // count timeouts
boolean timedOut = (Boolean)rsp.getResponseHeader().get("partialResults") == null ? false : (Boolean)rsp.getResponseHeader().get("partialResults"); NamedList header = rsp.getResponseHeader();
if( timedOut ) { if(header != null) {
numTimeouts++; Object partialResults = header.get("partialResults");
rsp.setHttpCaching(false); boolean timedOut = partialResults == null ? false : (Boolean)partialResults;
if( timedOut ) {
numTimeouts++;
rsp.setHttpCaching(false);
}
} }
} catch (Exception e) { } catch (Exception e) {
SolrException.log(SolrCore.log,e); SolrException.log(SolrCore.log,e);