Skip to content
Snippets Groups Projects
Commit aa61b9d1 authored by apvrille's avatar apvrille
Browse files

Resolving bug on exception when searching help with no result

parent 72585a9c
No related branches found
No related tags found
No related merge requests found
......@@ -132,16 +132,19 @@ public class SearchResultHelpEntry extends HelpEntry {
Vector<HelpEntry> tmp = new Vector<>();
Vector<AtomicInteger> tmpScores = new Vector<>();
int cpt = 0;
for(HelpEntry he: entries) {
int indexOriginal = tmp.indexOf(he);
if (indexOriginal > -1) {
AtomicInteger right = tmpScores.get(indexOriginal);
right.addAndGet(scores.get(cpt).intValue());
} else {
tmp.add(he);
tmpScores.add(new AtomicInteger(scores.get(cpt).intValue()));
if (entries != null) {
for (HelpEntry he : entries) {
int indexOriginal = tmp.indexOf(he);
if (indexOriginal > -1) {
AtomicInteger right = tmpScores.get(indexOriginal);
right.addAndGet(scores.get(cpt).intValue());
} else {
tmp.add(he);
tmpScores.add(new AtomicInteger(scores.get(cpt).intValue()));
}
cpt++;
}
cpt ++;
}
scores = tmpScores;
entries = tmp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment