Project: Eclipse_Platform_UI
Bug 206178 [Contributions] null pointer referenced is not caught when registering an action ActionBarAdvisor
Reported: 2007-10-12 14:13:25 | Status: verified fixed

If an error in ApplicationActionBarAdivosor-class occurs the application is just terminated, but does not throw an exception on console, even not in debug mode. Example: Save Action. When the save action is not created in the RCP's ActionBarAdvisor, but tried to be registered the application is just terminated. A possible solution might be: protected void register(IAction action) { try{ String id = action.getId(); // Assert.isNotNull(id, "Action must not have null id"); //$NON-NLS-1$ getActionBarConfigurer().registerGlobalAction(action); actions.put(id, action); } catch(NullPointerException e){ String message = "The to registered action element pointed to null."; //$NON-NLS-1$ WorkbenchPlugin.log(new Status(IStatus.ERROR, String.valueOf(WorkbenchPlugin.getDefault().getBundle().getBundleId()), message,e )); } }

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/application/ActionBarAdvisor.java