提交 7c353a6c 编写于 作者: J Jan S 提交者: skylot

fix(gui): unsynchronized search index creation results in NullPointerException...

fix(gui): unsynchronized search index creation results in NullPointerException upon performing search (#429)
上级 72b26639
...@@ -180,6 +180,7 @@ public class SearchDialog extends CommonSearchDialog { ...@@ -180,6 +180,7 @@ public class SearchDialog extends CommonSearchDialog {
.toList() .toList()
.toFlowable(), 1) .toFlowable(), 1)
.observeOn(SwingSchedulers.edt()) .observeOn(SwingSchedulers.edt())
.doOnError(e -> LOG.error("Error while searching: {}", e.getMessage(), e))
.subscribe(this::processSearchResults); .subscribe(this::processSearchResults);
} }
......
...@@ -23,7 +23,7 @@ public class CodeIndex<T> implements SearchIndex<T> { ...@@ -23,7 +23,7 @@ public class CodeIndex<T> implements SearchIndex<T> {
} }
@Override @Override
public void put(StringRef str, T value) { public synchronized void put(StringRef str, T value) {
if (str == null || str.length() == 0) { if (str == null || str.length() == 0) {
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册