Bug 329918 NPE thrown when activating a part after resetting a perspective without an editor area and the last active part was in the area
1. Open a perspective without an editor area. 2. Open a file. 3. The editor is now active. 4. Window > Reset Perspective... > OK 5. Try to activate a view. An NPE is thrown. Caused by: java.lang.NullPointerException at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.setCSSInfo(SWTPartRenderer.java:68) at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.trackActivePart(WBWRenderer.java:131) at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:52) ... 53 more
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ElementReferenceRenderer.java
* @return The list of rendered place holders (may be null)
	 */
	public static List<MPlaceholder> getRenderedPlaceholders(MUIElement element) {
		return renderedMap.get(element);
	}
	@Inject
	IPresentationEngine renderingEngine;
	public Object createWidget(final MUIElement element, Object parent) {
		MPlaceholder ph = (MPlaceholder) element;
		final MUIElement ref = ph.getRef();
		ref.setCurSharedRef(ph);
		List<MPlaceholder> renderedRefs = renderedMap.get(ref);
		if (renderedRefs == null) {
			renderedRefs = new ArrayList<MPlaceholder>();
			renderedMap.put(ref, renderedRefs);
		}
		if (!renderedRefs.contains(ph))
			renderedRefs.add(ph);
		Composite newComp = new Composite((Composite) parent, SWT.NONE);
		newComp.setLayout(new FillLayout());
		Control refWidget = (Control) ref.getWidget();
		if (refWidget == null) {
			ref.setToBeRendered(true);
			refWidget = (Control) renderingEngine.createGui(ref, newComp,
					getContextForParent(ref));
		} else {
			if (refWidget.getParent() != newComp) {
				refWidget.setParent(newComp);
			}
		}