mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
fix npe when a hit is in the file name and so the "parent" index entry is returned, which does not include a chunksize. Allways accept these hits.
This commit is contained in:
parent
3ada14c54d
commit
adbc85f744
@ -223,8 +223,8 @@ class LuceneQuery implements KeywordSearchQuery {
|
|||||||
final Integer chunkSize = (Integer) resultDoc.getFieldValue(Server.Schema.CHUNK_SIZE.toString());
|
final Integer chunkSize = (Integer) resultDoc.getFieldValue(Server.Schema.CHUNK_SIZE.toString());
|
||||||
final String content_str = resultDoc.get(Server.Schema.CONTENT_STR.toString()).toString();
|
final String content_str = resultDoc.get(Server.Schema.CONTENT_STR.toString()).toString();
|
||||||
|
|
||||||
Integer firstOccurence = content_str.indexOf(strippedQueryString);
|
int firstOccurence = content_str.indexOf(strippedQueryString);
|
||||||
if (firstOccurence < chunkSize) {
|
if (chunkSize != null && firstOccurence < chunkSize) {
|
||||||
matches.add(createKeywordtHit(highlightResponse, docId));
|
matches.add(createKeywordtHit(highlightResponse, docId));
|
||||||
}
|
}
|
||||||
} catch (TskException ex) {
|
} catch (TskException ex) {
|
||||||
|
@ -243,7 +243,7 @@ final class RegexQuery implements KeywordSearchQuery {
|
|||||||
while (hitMatcher.find(offset)) {
|
while (hitMatcher.find(offset)) {
|
||||||
StringBuilder snippet = new StringBuilder();
|
StringBuilder snippet = new StringBuilder();
|
||||||
|
|
||||||
if (hitMatcher.start() >= chunkSize) {
|
if (chunkSize != null && hitMatcher.start() >= chunkSize) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user