Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-02-19 06:54:33 -0500
committerCamille Letavernier2014-02-19 06:58:27 -0500
commit112b8e395202be05fc482f152ad9e38435946b3e (patch)
treefc5882af0e217ebb9fe36e1dbbb6201dcf6d1fcd
parent493f50a6d1abbc1f06b591918c4e209ba04f56cb (diff)
downloadorg.eclipse.papyrus-112b8e395202be05fc482f152ad9e38435946b3e.tar.gz
org.eclipse.papyrus-112b8e395202be05fc482f152ad9e38435946b3e.tar.xz
org.eclipse.papyrus-112b8e395202be05fc482f152ad9e38435946b3e.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.java10
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);
}
}

Back to the top