fix(gui): unsynchronized search index creation results in NullPointerException upon performing search (#429)

This commit is contained in:
Jan S
2019-01-15 11:05:45 +01:00
committed by skylot
parent 72b2663949
commit 7c353a6c6f
2 changed files with 2 additions and 1 deletions
@@ -180,6 +180,7 @@ public class SearchDialog extends CommonSearchDialog {
.toList()
.toFlowable(), 1)
.observeOn(SwingSchedulers.edt())
.doOnError(e -> LOG.error("Error while searching: {}", e.getMessage(), e))
.subscribe(this::processSearchResults);
}
@@ -23,7 +23,7 @@ public class CodeIndex<T> implements SearchIndex<T> {
}
@Override
public void put(StringRef str, T value) {
public synchronized void put(StringRef str, T value) {
if (str == null || str.length() == 0) {
return;
}