diff options
author | Camille Letavernier | 2014-10-20 11:51:05 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-10-20 11:51:05 +0000 |
commit | d9b93e4cddd2c4918ed641904a45a354b2ace31e (patch) | |
tree | 88aa73fadfad755def2b4bf801c40c38ce339bdb /plugins/infra/emf | |
parent | 61498f10f78c137b5fa0cc3bee4e0390850cfdab (diff) | |
download | org.eclipse.papyrus-d9b93e4cddd2c4918ed641904a45a354b2ace31e.tar.gz org.eclipse.papyrus-d9b93e4cddd2c4918ed641904a45a354b2ace31e.tar.xz org.eclipse.papyrus-d9b93e4cddd2c4918ed641904a45a354b2ace31e.zip |
447902: [Properties View] NullPointerException on Stereotype
Associations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=447902
Diffstat (limited to 'plugins/infra/emf')
-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;
}
|