Skip to content

Commit

Permalink
Issue #269
Browse files Browse the repository at this point in the history
DockableMenuItem now catches all exceptions. Issue #272 will make this handling better in the 1.1 release.
  • Loading branch information
andrewauclair committed Jan 27, 2025
1 parent 061cb55 commit 258d8da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docking-multi-app/src/ModernDocking/app/DockableMenuItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,13 @@ public void addNotify() {
super.addNotify();

// update the menu item, it's about to be displayed
Dockable dockable = DockingInternal.get(docking).getDockable(persistentIDProvider != null ? persistentIDProvider.get() : persistentID);
setSelected(docking.isDocked(dockable));
try {
Dockable dockable = DockingInternal.get(docking).getDockable(persistentIDProvider != null ? persistentIDProvider.get() : persistentID);
setSelected(docking.isDocked(dockable));
}
catch (Exception ignored) {
setVisible(false);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void addNotify() {
Dockable dockable = DockingInternal.get(Docking.getSingleInstance()).getDockable(persistentIDProvider != null ? persistentIDProvider.get() : persistentID);
setSelected(Docking.isDocked(dockable));
}
catch (DockableRegistrationFailureException ignored) {
catch (Exception ignored) {
setVisible(false);
}
}
Expand Down

0 comments on commit 258d8da

Please sign in to comment.