Skip to content

Commit c6d158a

Browse files
committed
Bugfix for outline selection , closes #66
- had problems on bash editor because the matching result can be null and accidently used autoboxing (because of the simple name isMatching) to boolean resulted in a NPE
1 parent 79e4643 commit c6d158a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

basheditor-plugin/src/main/java-eclipse/de/jcup/basheditor/AbstractFilterableTreeQuickDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ private boolean selectfirstMatching(Object[] elements) {
396396
}
397397
for (int i = 0; i < elements.length; i++) {
398398
Object element = elements[i];
399-
if (textFilter.isMatching(element)) {
399+
if (Boolean.TRUE.equals(textFilter.isMatchingOrNull(element))) {
400400
StructuredSelection selection = new StructuredSelection(element);
401401
treeViewer.setSelection(selection, true);
402402
return true;

basheditor-plugin/src/main/java-eclipse/de/jcup/basheditor/AbstractTreeViewerFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ private boolean selectTreePath(Viewer viewer, TreePath parentPath, Object elemen
7171
return true;
7272
}
7373
TreeViewer treeViewer = (TreeViewer) viewer;
74-
Boolean matchingResult = isMatching(element);
74+
Boolean matchingResult = isMatchingOrNull(element);
7575
if (matchingResult != null) {
7676
return matchingResult;
7777
}
7878
return hasUnfilteredChild(treeViewer, parentPath, element);
7979
}
8080

8181
@SuppressWarnings("unchecked")
82-
Boolean isMatching(Object element) {
82+
Boolean isMatchingOrNull(Object element) {
8383
T item = null;
8484
try {
8585
item = (T) element;

0 commit comments

Comments
 (0)