[467823] NPE in Properties View
Bug:467823
Change-Id: I23569d45ab390c5432e2c5f8e5352ed6812ac35c
Signed-off-by: Boubekeur Zendagui <boubekeur.zendagui@obeo.fr>
diff --git a/org.eclipse.emf.ecoretools.design.properties/src/org/eclipse/emf/ecoretools/design/properties/EcoreToolsPropertiesEditingPart.java b/org.eclipse.emf.ecoretools.design.properties/src/org/eclipse/emf/ecoretools/design/properties/EcoreToolsPropertiesEditingPart.java
index e8abc10..59fdb7b 100644
--- a/org.eclipse.emf.ecoretools.design.properties/src/org/eclipse/emf/ecoretools/design/properties/EcoreToolsPropertiesEditingPart.java
+++ b/org.eclipse.emf.ecoretools.design.properties/src/org/eclipse/emf/ecoretools/design/properties/EcoreToolsPropertiesEditingPart.java
@@ -295,12 +295,23 @@
Object tab = descriptor.get(key);
Method getSectionAtIndex = getMethod(tab, "getSectionAtIndex", int.class); //$NON-NLS-1$
if (getSectionAtIndex != null) {
- Object result = callMethod(tab, getSectionAtIndex, new Integer(0));
- if (result == this) {
- Method getId = getMethod(key, "getId"); //$NON-NLS-1$
- if (getId != null) {
- String id = (String)callMethod(key, getId);
- return id;
+ Method getSections = getMethod(tab, "getSections"); //$NON-NLS-1$
+ Object tabSections = callMethod(tab, getSections);
+ if (tabSections != null)
+ {
+ final ISection[] sections = (ISection[])tabSections;
+ for (int i = 0; i < sections.length; i++)
+ {
+ Object result = callMethod(tab, getSectionAtIndex, new Integer(i));
+ if (result == this)
+ {
+ Method getId = getMethod(key, "getId"); //$NON-NLS-1$
+ if (getId != null)
+ {
+ String id = (String)callMethod(key, getId);
+ return id;
+ }
+ }
}
}
}