Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
index 4426ec7fc7..24ec2e19f3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
@@ -79,7 +79,11 @@ public abstract class AbstractJavaAttributeMapping<T extends JavaResourceNode> e
}
public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getMappingResource().getTextRange(astRoot);
+ TextRange textRange = null;
+ T mappingResource = getMappingResource();
+ if (mappingResource != null) {
+ textRange = mappingResource.getTextRange(astRoot);
+ }
return (textRange != null) ? textRange : this.getPersistentAttribute().getValidationTextRange(astRoot);
}

Back to the top