diff options
author | Camille Letavernier | 2014-02-19 11:54:33 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-02-19 13:20:32 +0000 |
commit | 0335af730818c1a257064d79e0ae1a7bc701fc39 (patch) | |
tree | 8b03bc0adc1fe2232608b754248dea924e44908e | |
parent | 4d7d65b19841b56a1f19fa966f490d8860fa5faa (diff) | |
download | org.eclipse.papyrus-0335af730818c1a257064d79e0ae1a7bc701fc39.tar.gz org.eclipse.papyrus-0335af730818c1a257064d79e0ae1a7bc701fc39.tar.xz org.eclipse.papyrus-0335af730818c1a257064d79e0ae1a7bc701fc39.zip |
[Properties View] Fix potential NPEs in the Stereotype properties view
-rw-r--r-- | plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java index 8843c04ca19..94f5a7a61cc 100644 --- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java +++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java @@ -65,6 +65,9 @@ public class StereotypeModelElement extends EMFModelElement { public IObservable doGetObservable(String propertyPath) {
FeaturePath featurePath = getFeaturePath(propertyPath);
EStructuralFeature feature = getFeature(featurePath);
+ if(feature == null) {
+ return super.doGetObservable(propertyPath);
+ }
if(feature.getEType() instanceof EDataType && !(feature.getEType() instanceof EEnum)) {
if(feature.getUpperBound() == 1) {
@@ -89,6 +92,9 @@ public class StereotypeModelElement extends EMFModelElement { @Override
public ILabelProvider getLabelProvider(String propertyPath) {
EStructuralFeature feature = getFeature(propertyPath);
+ if(feature == null) {
+ return super.getLabelProvider(propertyPath);
+ }
if(feature.getEType() instanceof EEnum) {
return super.getLabelProvider(propertyPath);
}
@@ -102,6 +108,10 @@ public class StereotypeModelElement extends EMFModelElement { public IStaticContentProvider getContentProvider(String propertyPath) {
EStructuralFeature feature = getFeature(propertyPath);
+ if(feature == null) {
+ return super.getContentProvider(propertyPath);
+ }
+
return new UMLContentProvider(source, feature, stereotype);
}
}
|