Bug 331062 NPE with EModelService's getElementLocation(MUIElement) on a model within a perspective that's not under the application
java.lang.NullPointerException at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getElementLocation(ModelServiceImpl.java:740)
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
if (!foundNewSelection) {
				ps.setSelectedElement(null);
			}
		}
		
		resetPerspectiveModel(persp, window);
		
		persp.setToBeRendered(false);
		ps.getChildren().remove(persp);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.e4.ui.workbench.modeling.EModelService#getActivePerspective(org.eclipse.e4.ui
	 * .model.application.ui.basic.MWindow)
	 */
	public MPerspective getActivePerspective(MWindow window) {
		List<MPerspectiveStack> pStacks = findElements(window, null, MPerspectiveStack.class, null);
		if (pStacks.size() == 1)
			return pStacks.get(0).getSelectedElement();
		return null;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.e4.ui.workbench.modeling.EModelService#toBeRenderedCount(org.eclipse.e4.ui.model
	 * .application.ui.MElementContainer)
	 */