mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
EA-1071353 Filter out null elements in ProjectViewImpl.SelectionInfo.create
Likely the exception happens because something is invalidated or disposed. We can safely ignore nulls here, the worst that can happen is that some element won't be re-selected properly, which is still much better than an exception being thrown, and at least other, still valid, elements will be re-selected. GitOrigin-RevId: ce9cd345dd96175e3f53db249d1e3a9725c31efc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
54354060a6
commit
e3b8643771
@@ -1735,9 +1735,9 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
|
||||
}
|
||||
|
||||
private static final class SelectionInfo {
|
||||
private final Object @NotNull [] elements;
|
||||
private final @NotNull Object @NotNull [] elements;
|
||||
|
||||
private SelectionInfo(Object @NotNull [] elements) {
|
||||
private SelectionInfo(@NotNull Object @NotNull [] elements) {
|
||||
this.elements = elements;
|
||||
}
|
||||
|
||||
@@ -1768,7 +1768,10 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
|
||||
for (TreePath path : selectionPaths) {
|
||||
NodeDescriptor<?> descriptor = TreeUtil.getLastUserObject(NodeDescriptor.class, path);
|
||||
if (descriptor != null) {
|
||||
selectedElements.add(descriptor.getElement());
|
||||
Object element = descriptor.getElement();
|
||||
if (element != null) {
|
||||
selectedElements.add(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user