diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/ui/components/GlobalActionDisablementHandler.java b/com.archimatetool.editor/src/com/archimatetool/editor/ui/components/GlobalActionDisablementHandler.java index 7be6c918a..69155d018 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/ui/components/GlobalActionDisablementHandler.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/ui/components/GlobalActionDisablementHandler.java @@ -104,8 +104,7 @@ public void clearGlobalActions() { * Restore the Global Action Handlers that were set to null */ public void restoreGlobalActions() { - if(actionBars != null) { - // Restore Actions + if(actionBars != null && !PlatformUI.getWorkbench().isClosing()) { // Ensure we're not closing the workbench try { for(Entry entry : savedActions.entrySet()) { actionBars.setGlobalActionHandler(entry.getKey(), entry.getValue()); @@ -116,10 +115,12 @@ public void restoreGlobalActions() { // Update actionBars.updateActionBars(); } - catch(NullPointerException ex) { + catch(Exception ex) { + ex.printStackTrace(); // Catch this because in Archi 4.5 and later (Eclipse 4.11 and later) if we are editing // in a DirectEditManager and close the app we get a NPE in Eclipse - // this just stops the NPE written to the log + // this just stops the NPE written to the log. + // Note we shouldn't get this now as we check PlatformUI.getWorkbench().isClosing() } } }