Bug 320791 NPE on workbench shutdown
This happens for me on rc3 when shuting down: java.lang.NullPointerException at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.notifyListeners(SelectionServiceImpl.java:192) at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.access$3(SelectionServiceImpl.java:191) at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl$2.changed(SelectionServiceImpl.java:230) at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:95) at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:333) at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:350) at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$2.run(ShellActivationListener.java:127) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.activate(ShellActivationListener.java:124) at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.handleEvent(ShellActivationListener.java:74)
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/SelectionServiceImpl.java
}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.e4.ui.selection.ESelectionService#addSelectionListener(java.lang.String,
	 * org.eclipse.e4.ui.selection.ISelectionListener)
	 */
	public void addSelectionListener(String partId, ISelectionListener listener) {
		IEclipseContext rootContext = serviceRoot.getContext();
		if (rootContext != context) {
			ESelectionService selectionService = (ESelectionService) rootContext
					.get(ESelectionService.class.getName());
			selectionService.addSelectionListener(partId, listener);
		}
		ListenerList listeners = targetedListeners.get(partId);
		if (listeners == null) {
			listeners = new ListenerList();
			targetedListeners.put(partId, listeners);
		}
		listeners.add(listener);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.e4.ui.selection.ESelectionService#removeSelectionListener(java.lang.String,
	 * org.eclipse.e4.ui.selection.ISelectionListener)
	 */
	public void removeSelectionListener(String partId, ISelectionListener listener) {
		
		if (serviceRoot != null && context != null) {