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
element = placeholder;
			}
			EObject container = ((EObject) element).eContainer();
			if (container == null || container instanceof MApplication) {
				
				return null;
			} else if (container instanceof MPerspectiveStack) {
				
				return (MPerspective) element;
			}
			
			element = (MUIElement) container;
		}
	}
	public void resetPerspectiveModel(MPerspective persp, MWindow window) {
		if (persp == null)
			return;
		
		for (MWindow win : persp.getWindows()) {
			win.setToBeRendered(false);
		}
		persp.getWindows().clear();
		
		List<MTrimBar> bars = findElements(window, null, MTrimBar.class, null);
		List<MToolControl> toRemove = new ArrayList<MToolControl>();
		for (MTrimBar bar : bars) {
			for (MUIElement barKid : bar.getChildren()) {
				if (!(barKid instanceof MToolControl))
					continue;
				String id = barKid.getElementId();