Fix for Bug 349247 - [wizard] invoking the new team wizard from the PDE editor throws NPE
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java
index c002a9e..060d34b 100644
--- a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java
@@ -786,7 +786,7 @@
     @Override
     protected IJavaElement getInitialJavaElement(IStructuredSelection structuredSelection) {
     	IJavaElement element = super.getInitialJavaElement(structuredSelection);
-    	if (element.getElementType() == IJavaElement.COMPILATION_UNIT) {
+    	if (element != null && element.getElementType() == IJavaElement.COMPILATION_UNIT) {
     		// try to improve:
     		IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow();
     		if (window != null) {