Skip to content
Permalink
Browse files

Fixed NullPointerException when omitHeader=true on external Solr server

  • Loading branch information...
luccioman committed May 18, 2018
1 parent c4d984c commit 65854bcb224633ac0a844c213bc3ec74756d5556
Showing with 11 additions and 7 deletions.
  1. +11 −7 source/net/yacy/cora/federate/solr/instance/ResponseAccumulator.java
@@ -49,13 +49,17 @@ public ResponseAccumulator() {

public void addResponse(NamedList<Object> response) {
// set the header; this is mostly always the same (well this is not evaluated much)
@SuppressWarnings("unchecked")
SimpleOrderedMap<Object> header = (SimpleOrderedMap<Object>) response.get("responseHeader");
//Integer status = (Integer) header.get("status");
//Integer QTime = (Integer) header.get("QTime");
//SimpleOrderedMap<Object> params = (SimpleOrderedMap<Object>) header.get("params");
if (headerAcc.size() == 0) {
for (Map.Entry<String, Object> e: header) headerAcc.add(e.getKey(), e.getValue());
final Object headerObj = response.get("responseHeader");
if(headerObj instanceof SimpleOrderedMap) {
//Integer status = (Integer) header.get("status");
//Integer QTime = (Integer) header.get("QTime");
//SimpleOrderedMap<Object> params = (SimpleOrderedMap<Object>) header.get("params");
final SimpleOrderedMap<?> header = (SimpleOrderedMap<?>) headerObj;
if (headerAcc.size() == 0) {
for (final Map.Entry<String, ?> e: header) {
headerAcc.add(e.getKey(), e.getValue());
}
}
}

// accumulate the results

0 comments on commit 65854bc

Please sign in to comment.
You can’t perform that action at this time.