Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Cartaud2016-10-04 11:10:14 -0400
committerMathieu Cartaud2016-10-13 09:36:03 -0400
commitd53adfdb2eb42f3b119c7cc8c542ac18e171bd10 (patch)
tree396953b6fb1af257e485127a55f6594ee24028b1
parentf2cca409028066255b8eb26e2c015146a2381092 (diff)
downloadorg.eclipse.emf.compare-d53adfdb2eb42f3b119c7cc8c542ac18e171bd10.tar.gz
org.eclipse.emf.compare-d53adfdb2eb42f3b119c7cc8c542ac18e171bd10.tar.xz
org.eclipse.emf.compare-d53adfdb2eb42f3b119c7cc8c542ac18e171bd10.zip
[502834] Fix NPE in OpaqueElementBodyChangeAccessor
Bug: 502834 Change-Id: Idc0913e0c4caec4856d91adf4322b2242bf3f6de Signed-off-by: Mathieu Cartaud <mathieu.cartaud@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.rcp.ui/src/org/eclipse/emf/compare/uml2/rcp/ui/internal/accessor/OpaqueElementBodyChangeAccessor.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.rcp.ui/src/org/eclipse/emf/compare/uml2/rcp/ui/internal/accessor/OpaqueElementBodyChangeAccessor.java b/plugins/org.eclipse.emf.compare.uml2.rcp.ui/src/org/eclipse/emf/compare/uml2/rcp/ui/internal/accessor/OpaqueElementBodyChangeAccessor.java
index e22c79402..36e38bef9 100644
--- a/plugins/org.eclipse.emf.compare.uml2.rcp.ui/src/org/eclipse/emf/compare/uml2/rcp/ui/internal/accessor/OpaqueElementBodyChangeAccessor.java
+++ b/plugins/org.eclipse.emf.compare.uml2.rcp.ui/src/org/eclipse/emf/compare/uml2/rcp/ui/internal/accessor/OpaqueElementBodyChangeAccessor.java
@@ -14,6 +14,7 @@ import com.google.common.base.Optional;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import java.util.Collections;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -111,6 +112,9 @@ public class OpaqueElementBodyChangeAccessor extends AbstractTypedElementAdapter
*/
@SuppressWarnings("unchecked")
private List<String> getLanguageValues() {
+ if (eObject == null) {
+ return Collections.emptyList();
+ }
return (List<String>)ReferenceUtil.safeEGet(eObject, getLanguageFeature());
}
@@ -121,6 +125,9 @@ public class OpaqueElementBodyChangeAccessor extends AbstractTypedElementAdapter
*/
@SuppressWarnings("unchecked")
private List<String> getBodyValues() {
+ if (eObject == null) {
+ return Collections.emptyList();
+ }
return (List<String>)ReferenceUtil.safeEGet(eObject, getBodyFeature());
}

Back to the top