Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2018-10-05 12:07:07 -0400
committerOlivier Constant2018-10-05 12:07:07 -0400
commitb4095ea6ed615e0156eb33b1532463c75143505b (patch)
treef02943b541f0c9a91a9e87b98b8e18694ffe71eb
parent8bc4778ff941389a08c11f498b16109e320f43af (diff)
downloadorg.eclipse.emf.diffmerge.core-b4095ea6ed615e0156eb33b1532463c75143505b.tar.gz
org.eclipse.emf.diffmerge.core-b4095ea6ed615e0156eb33b1532463c75143505b.tar.xz
org.eclipse.emf.diffmerge.core-b4095ea6ed615e0156eb33b1532463c75143505b.zip
Added catching of E4 NPE when comparison is updated
Change-Id: I88f7e8a8063b5c178c64be296b956f3418f1512c Signed-off-by: Olivier Constant <olivier.constant@thalesgroup.com>
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/AbstractComparisonViewer.java8
-rw-r--r--plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java2
2 files changed, 8 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/AbstractComparisonViewer.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/AbstractComparisonViewer.java
index 9b2e317b..0ccabded 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/AbstractComparisonViewer.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/AbstractComparisonViewer.java
@@ -673,7 +673,13 @@ implements IFlushable, IPropertyChangeNotifier, ICompareInputChangeListener, IAd
_redoAction.update();
}
if (_actionBars != null) {
- _actionBars.updateActionBars();
+ try {
+ _actionBars.updateActionBars();
+ } catch (NullPointerException e) {
+ // E4 bug when setInput is called on an already open editor:
+ // NPE at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.canExecuteItem
+ // Give up and proceed.
+ }
}
}
diff --git a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java
index 19b8abf8..65619ae1 100644
--- a/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java
+++ b/plugins/org.eclipse.emf.diffmerge.ui/src/org/eclipse/emf/diffmerge/ui/viewers/ComparisonViewer.java
@@ -469,7 +469,7 @@ public class ComparisonViewer extends AbstractComparisonViewer {
return result;
}
- /**
+ /**
* @see org.eclipse.emf.diffmerge.ui.viewers.AbstractComparisonViewer#createControls(org.eclipse.swt.widgets.Composite)
*/
@Override

Back to the top