Project: SWT
Bug 277195 FileDialog NPE's when attempting to upload an attachment with Mylyn
Reported: 2009-05-20 15:04:32 | Status: resolved fixed

Eclipse SDK Version: 3.5.0 Build id: I20090518-2000 Steps to reproduce: * Open a Mylyn task editor for some issue on Eclipse.org (or your favourite issue tracker). * Expand the Attachments section and hit the Attach... button to spawn a dialog. * In the Add Attachment dialog hit the Browse... button and use the file dialog to select some local file * Notice that upon selecting a file and dismissing the dialog, the File field is not populated. java.lang.NullPointerException at org.eclipse.swt.widgets.FileDialog.open(FileDialog.java:261) at org.eclipse.mylyn.internal.tasks.ui.wizards.AttachmentSourcePage$5.widgetSelected(AttachmentSourcePage.java:302) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1246) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1269) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1254) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1075) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3441) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java