mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
bugfix, fixed null ptr exception for some cases when there is no highlight snippet
This commit is contained in:
parent
c8ffe6005f
commit
c890d69ac5
@ -19,6 +19,7 @@
|
|||||||
package org.sleuthkit.autopsy.keywordsearch;
|
package org.sleuthkit.autopsy.keywordsearch;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import org.apache.commons.lang.StringEscapeUtils;
|
import org.apache.commons.lang.StringEscapeUtils;
|
||||||
import org.apache.solr.client.solrj.SolrQuery;
|
import org.apache.solr.client.solrj.SolrQuery;
|
||||||
import org.apache.solr.client.solrj.SolrServerException;
|
import org.apache.solr.client.solrj.SolrServerException;
|
||||||
@ -64,7 +65,12 @@ class KeywordSearchFilterNode extends FilterNode {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
QueryResponse response = solrCore.query(q);
|
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) {
|
if (contentHighlights == null) {
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user