summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2013-03-11 15:32:27 (EDT)
committer Neil Hauge2013-03-11 15:32:27 (EDT)
commit5878dc5a4950a75e60d2d920403b7a891d6cb388 (patch)
treed0ee3ad19af8bced08b192e6e22410656d86848d
parent08359eaa91529257f8e36ba2938c837b4c1a1df5 (diff)
downloadwebtools.dali-5878dc5a4950a75e60d2d920403b7a891d6cb388.zip
webtools.dali-5878dc5a4950a75e60d2d920403b7a891d6cb388.tar.gz
webtools.dali-5878dc5a4950a75e60d2d920403b7a891d6cb388.tar.bz2
402698 - Fix NullPointerException when opening metadata conversion
wizard without valid mapping file.
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java
index cb07678..14a936f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java
@@ -40,6 +40,7 @@ import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
import org.eclipse.jpt.common.utility.command.Command;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
+import org.eclipse.jpt.common.utility.internal.iterator.EmptyIterator;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
@@ -628,7 +629,10 @@ public abstract class JavaMetadataConversionWizardPage
* Return the root structure nodes of the given XML resource
*/
protected Iterator<JpaStructureNode> getRootStructureNodes(JptXmlResource ormXmlResource) {
- return this.jpaProject.getJpaFile(ormXmlResource.getFile()).getRootStructureNodes().iterator();
+ if (ormXmlResource == null) {
+ return EmptyIterator.instance();
+ }
+ return this.jpaProject.getJpaFile(ormXmlResource.getFile()).getRootStructureNodes().iterator();
}
@Override