mirror of
https://github.com/elisspace/autopsy.git
synced 2026-10-06 09:16:21 +00:00
bugfix, fixed null ptr exception for some cases when there is no highlight snippet
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.keywordsearch;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
@@ -64,7 +65,12 @@ class KeywordSearchFilterNode extends FilterNode {
|
||||
|
||||
try {
|
||||
QueryResponse response = solrCore.query(q);
|
||||
List<String> contentHighlights = response.getHighlighting().get(Long.toString(content.getId())).get("content");
|
||||
Map<String,Map<String,List<String>>>responseHighlight = response.getHighlighting();
|
||||
long contentID = content.getId();
|
||||
Map<String,List<String>>responseHighlightID = responseHighlight.get(Long.toString(contentID));
|
||||
if (responseHighlightID == null)
|
||||
return "";
|
||||
List<String> contentHighlights = responseHighlightID.get("content");
|
||||
if (contentHighlights == null) {
|
||||
return "";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user