diff options
author | Camille Letavernier | 2014-10-20 11:51:05 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-10-20 11:54:56 +0000 |
commit | a6240bd3371efd667e4831f69f1eee26eb5dcb6f (patch) | |
tree | 8d488decd7859426ff2bbc0cbaa4cf2735c2839e /plugins/infra | |
parent | 4ed8958a9c94bc466e87119e9a30335b16e07a2e (diff) | |
download | org.eclipse.papyrus-a6240bd3371efd667e4831f69f1eee26eb5dcb6f.tar.gz org.eclipse.papyrus-a6240bd3371efd667e4831f69f1eee26eb5dcb6f.tar.xz org.eclipse.papyrus-a6240bd3371efd667e4831f69f1eee26eb5dcb6f.zip |
447902: [Properties View] NullPointerException on Stereotype
Associations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=447902
Diffstat (limited to 'plugins/infra')
-rw-r--r-- | plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java index 214bda7c03b..c2ca3126668 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java @@ -737,8 +737,13 @@ public class EMFHelper { * true if the feature is required, false otherwise
*/
public static boolean isRequired(final EStructuralFeature feature) {
+ EClassifier eType = feature.getEType();
+ if (eType == null) {
+ return false;
+ }
+
// EEnums are always required, as an EEnum always has a default value
- if (feature.getEType() instanceof EEnum) {
+ if (eType instanceof EEnum) {
return true;
}
@@ -749,7 +754,7 @@ public class EMFHelper { // Java primitive types cannot have a null value
// if the feature is not specifically marked as unsettable, then it is required
- if (feature.getEType().getInstanceClass().isPrimitive() && !feature.isUnsettable()) {
+ if (eType.getInstanceClass() != null && eType.getInstanceClass().isPrimitive() && !feature.isUnsettable()) {
return true;
}
|