Bug 278375 [ui] NPE on photo demo shutdown
NPE because the restore location is not set. PW
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/internal/Workbench.java
workbench = (MApplication<MWindow>) resourceSetImpl.getResource(
					restoreLocation, true).getContents().get(0);
		} else {
			System.err
					.println("Initializing workbench: " + applicationDefinitionInstance); 
			Resource resource = new XMIResourceImpl();
			workbench = loadDefaultModel(applicationDefinitionInstance);
			resource.getContents().add((EObject) workbench);
			resource.setURI(restoreLocation);
		}
		init();
		return workbench;
	}
	private MApplication<? extends MWindow> loadDefaultModel(
			URI defaultModelPath) {
		Resource resource = new ResourceSetImpl().getResource(defaultModelPath,
				true);
		MApplication<MWindow> app = (MApplication<MWindow>) resource
				.getContents().get(0);
		final EList<MWindow> windows = app.getWindows();
		for (MWindow window : windows) {
			processPartContributions(resource, window);
		}
		return app;
	}
	private void processPartContributions(Resource resource, MWindow mWindow) {
		IExtensionRegistry registry = RegistryFactory.getRegistry();
		String extId = "org.eclipse.e4.workbench.parts"; 
		IConfigurationElement[] parts = registry
				.getConfigurationElementsFor(extId);