[260045] - NPE when node mapping has no domain element
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java
index e1ecd4a..7d34456 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java
@@ -210,7 +210,7 @@
for (GenLink nextLink : myDiagram.getLinks()) {
if (nextLink.getModelFacet() == null) {
potentialLinks.add(nextLink);
- } else {
+ } else if (node.getModelFacet() != null) {
GenClass genClass = myIsInLinkDirection ? nextLink.getModelFacet().getSourceType() : nextLink.getModelFacet().getTargetType();
if (genClass != null && genClass.getEcoreClass().isSuperTypeOf(node.getDomainMetaClass().getEcoreClass())) {
potentialLinks.add(nextLink);
@@ -229,6 +229,11 @@
GenClass genClass = myIsInLinkDirection ? link.getModelFacet().getTargetType() : link.getModelFacet().getSourceType();
if (genClass != null) {
for (GenNode nextNode : myDiagram.getAllNodes()) {
+ if (nextNode.getModelFacet() == null) {
+ // skipping pure design nodes - cannot be incorrect
+ // connection source/target
+ continue;
+ }
if (genClass.getEcoreClass().isSuperTypeOf(nextNode.getDomainMetaClass().getEcoreClass())) {
potentialNodes.add(nextNode);
}