Project: Eclipse_Platform_UI
Bug 25548 [Error Handling] NPE trying to close broken view
Reported: 2002-10-30 12:12:02 | Status: resolved fixed

Build 20021029 When a part fails to initialize, trying to close that part causes an NPE on the last line of WorkbenchPage.getReference(IWorkbenchPage) which reads: return pane.getPartReference(); I debugged the problem and here's what the part variable looks like. Note that the pane of the ErrorViewPart is null. part= org.eclipse.ui.internal.ViewPane$1$ErrorViewPart (id=88) configElement= null imageDescriptor= null partSite= org.eclipse.ui.internal.ViewSite (id=92) actionBars= org.eclipse.ui.internal.ViewActionBars (id=109) configElement= org.eclipse.core.internal.plugins.ConfigurationElement (id=113) extensionID= "com.r2tech.eclipse.antview.views.AntView" extensionName= "AntView" keyBindingService= org.eclipse.ui.internal.KeyBindingService (id=119) page= org.eclipse.ui.internal.WorkbenchPage (id=39) pane= null part= org.eclipse.ui.internal.ViewPane$1$ErrorViewPart (id=88) pluginID= "com.r2tech.eclipse.antview" selectionProvider= null propChangeListeners= org.eclipse.jface.util.ListenerList (id=98) text= org.eclipse.swt.widgets.Text (id=100) title= "AntView" titleImage= null toolTip= null Here's the stack trace: !ENTRY org.eclipse.ui 4 4 Oct 30, 2002 11:04:45.472 !MESSAGE Unhandled exception caught in event loop. !ENTRY org.eclipse.ui 4 0 Oct 30, 2002 11:04:45.474 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPage.getReference(WorkbenchPage.java:2591) at org.eclipse.ui.internal.WorkbenchPage.hideView(WorkbenchPage.java:1397) at org.eclipse.ui.internal.WorkbenchPage.hideView(WorkbenchPage.java:1385) at org.eclipse.ui.internal.ViewPane.doHide(ViewPane.java:324) at org.eclipse.ui.internal.ViewPane$4.widgetSelected(ViewPane.java:158) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:87) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:839) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1464) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1419) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1402) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:831) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java