Bug 320989 NPE in CocoaUIHandler
This happened in my Tutorial-RCP when opening a second window and hitting CMD+Q. !ENTRY org.eclipse.e4.ui.workbench 4 0 2010-07-27 12:18:00.823 !MESSAGE Internal Error !STACK 0 java.lang.NullPointerException at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.findAction(CocoaUIHandler.java:662) at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.runAction(CocoaUIHandler.java:554) at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.quitMenuItemSelected(CocoaUIHandler.java:725) at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.actionProc(CocoaUIHandler.java:748) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4582) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4659) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3274) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:713)
bundles/org.eclipse.e4.ui.workbench.renderers.swt.cocoa/src/org/eclipse/e4/ui/workbench/renderers/swt/cocoa/CocoaUIHandler.java
byte[] types = { '*', '\0' };
		int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3;
		Class clazz = CocoaUIHandler.class;
		proc3Args = new Callback(clazz, "actionProc", 3); 
		
		Method getAddress = Callback.class
				.getMethod("getAddress", new Class[0]); 
		Object object = getAddress.invoke(proc3Args, null);
		long proc3 = convertToLong(object);
		if (proc3 == 0)
			SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
		
		Field field = OS.class.getField("class_NSObject"); 
		Object fieldObj = field.get(OS.class);
		object = invokeMethod(
				OS.class,
				"objc_allocateClassPair", new Object[] { fieldObj, "SWTCocoaEnhancerDelegate", wrapPointer(0) }); 
		long cls = convertToLong(object);
		invokeMethod(OS.class, "class_addIvar", new Object[] { 
				wrapPointer(cls), SWT_OBJECT, wrapPointer(size),
						new Byte((byte) align), types });
		
		invokeMethod(
				OS.class,
				"class_addMethod", new Object[] { wrapPointer(cls), wrapPointer(sel_toolbarButtonClicked_), wrapPointer(proc3), "@:@" }); 
		invokeMethod(OS.class, "class_addMethod", new Object[] { 
				wrapPointer(cls),
						wrapPointer(sel_preferencesMenuItemSelected_),
						wrapPointer(proc3), "@:@" }); 
		invokeMethod(