mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-16 09:47:42 +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 String content_str = resultDoc.get(Server.Schema.CONTENT_STR.toString()).toString();
|
||||
|
||||
Integer firstOccurence = content_str.indexOf(strippedQueryString);
|
||||
if (firstOccurence < chunkSize) {
|
||||
int firstOccurence = content_str.indexOf(strippedQueryString);
|
||||
if (chunkSize != null && firstOccurence < chunkSize) {
|
||||
matches.add(createKeywordtHit(highlightResponse, docId));
|
||||
}
|
||||
} catch (TskException ex) {
|
||||
|
@ -243,7 +243,7 @@ final class RegexQuery implements KeywordSearchQuery {
|
||||
while (hitMatcher.find(offset)) {
|
||||
StringBuilder snippet = new StringBuilder();
|
||||
|
||||
if (hitMatcher.start() >= chunkSize) {
|
||||
if (chunkSize != null && hitMatcher.start() >= chunkSize) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user