Bug 324230 NPE thrown when unrendering an MPartSashContainer that contains unrendered children
java.lang.NullPointerException at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.hideChild(SashRenderer.java:317) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.removeGui(PartRenderingEngine.java:517) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.removeGui(PartRenderingEngine.java:528)
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java
wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		assertNotNull(partA.getObject());
		assertNull(partB.getObject());
		
		appContext.get(EPartService.class).hidePart(partA, true);
		assertNull(partA.getObject());
		assertNotNull(partB.getObject());
	}
	public void testBug317591_NonSharedPart() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		final MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
		window.getChildren().add(stack);
		window.setSelectedElement(stack);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		stack.getChildren().add(partA);
		stack.setSelectedElement(partA);
		application.setContext(appContext);
		appContext.set(MApplication.class.getName(), application);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		assertNotNull(partA.getObject());
		stack.setToBeRendered(false);
		assertNull(partA.getObject());
	}