Project: Eclipse_Platform_UI
Bug 394764 [CSS] NPE closing last part in PartStack with "swt-show-close: true"
Reported: 2012-11-21 06:18:42 | Status: verified fixed

Overview: in my e4 Application a NullPointerException, when the last part inside of PartStack contained by Area is closed. The Exception occurs, when CSS "swt-show-close: true;" is added to "CTabItem:selected" Steps to Reproduce: Add have the following modelstructure to the e4 Application: <children xsi:type="advanced:Area" horizontal="true"> <children xsi:type="basic:PartStack"> <children xsi:type="basic:InputPart"/> </children>A </children> Apply the following CSS to the project: CTabItem:selected{ swt-show-close: true; } A NullPointerException is thorown, when the last Part in stack is closed: !ENTRY org.eclipse.e4.ui.workbench 4 0 2012-11-21 12:06:32.480 !MESSAGE Internal Error !STACK 0 java.lang.NullPointerException at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.getElement(AbstractCSSEngine.java:905) at org.eclipse.e4.ui.css.swt.properties.custom.CSSPropertyShowCloseHandler$ShowCloseSelectionListener.handleEvent(CSSPropertyShowCloseHandler.java:110) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1463) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4585) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4989) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Files changed in fix:
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertyShowCloseHandler.java