From 9d6790a4b2bfe3a05f5d5011cab9126de510de1e Mon Sep 17 00:00:00 2001 From: Christian W. Damus Date: Fri, 22 Mar 2013 16:01:59 -0400 Subject: [404184] [Dawn] NPE in DawnConflictHelper on View that has no element https://bugs.eclipse.org/bugs/show_bug.cgi?id=404184 --- .../emf/cdo/dawn/gmf/synchronize/DawnConflictHelper.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/synchronize/DawnConflictHelper.java b/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/synchronize/DawnConflictHelper.java index abc45a71b4..fe5ba57483 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/synchronize/DawnConflictHelper.java +++ b/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/synchronize/DawnConflictHelper.java @@ -7,6 +7,7 @@ * * Contributors: * Martin Fluegge - initial API and implementation + * Christian W. Damus (CEA) - Bug 404184: handle View that has no element */ package org.eclipse.emf.cdo.dawn.gmf.synchronize; @@ -84,7 +85,7 @@ public class DawnConflictHelper /** * TODO this method should decide whether the object is conflicted or not using special Policies * - * @param object + * @param object a non-{@code null} object * @return whether the object is conflicted */ public static boolean isConflicted(EObject object) @@ -96,10 +97,12 @@ public class DawnConflictHelper } if (object instanceof View) { - CDOObject element = CDOUtil.getCDOObject(((View)object).getElement()); - if (element.cdoConflict()) + // if the view is not, itself, conflicted, maybe its semantic element is (if it has one) + EObject element = ((View)object).getElement(); + if (element != null) { - return true; + CDOObject cdoElement = CDOUtil.getCDOObject(element); + return cdoElement.cdoConflict(); } } return false; -- cgit v1.2.3