Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Faltermeier2016-11-04 11:49:48 -0400
committerJohannes Faltermeier2016-11-04 11:50:02 -0400
commitb1eaeff888c862a6651f220352cbf5ed2f43be73 (patch)
tree870bc9d44ef7b1b637c65ccfb71f510acb1641da
parentf31625a6f8597fc463c70c99f3b10b3648eb0466 (diff)
downloadorg.eclipse.emf.edapt-b1eaeff888c862a6651f220352cbf5ed2f43be73.tar.gz
org.eclipse.emf.edapt-b1eaeff888c862a6651f220352cbf5ed2f43be73.tar.xz
org.eclipse.emf.edapt-b1eaeff888c862a6651f220352cbf5ed2f43be73.zip
Bug 498995 - AssertionFailedException below
ReconstructionView.showAffectedElements (thrown in StructuredSelection.<init>) * avoid NPE in UI Change-Id: Ia76d262b47f4697eb5c0dff77530837a49826658 Signed-off-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>
-rw-r--r--plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/reconstruction/ui/ReconstructionView.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/reconstruction/ui/ReconstructionView.java b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/reconstruction/ui/ReconstructionView.java
index 18136ba..15aa81e 100644
--- a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/reconstruction/ui/ReconstructionView.java
+++ b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/reconstruction/ui/ReconstructionView.java
@@ -137,8 +137,13 @@ public class ReconstructionView extends SyncedMetamodelEditorViewBase {
final ValueChange valueChange = (ValueChange) change;
final EObject element = reconstructor.getMapping().resolveTarget(
valueChange.getElement());
- structureViewer.setSelection(new StructuredSelection(element),
- true);
+ if (element != null) {
+ /*
+ * don't try to select an element in case we couldn't resolve the target.
+ * Otherwise we will get a NPE.
+ */
+ structureViewer.setSelection(new StructuredSelection(element), true);
+ }
}
} else if (change instanceof OperationChange) {
final OperationChange operationChange = (OperationChange) change;

Back to the top