Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2017-05-30 10:38:27 -0400
committerPierre-Charles David2017-05-30 10:50:58 -0400
commit77fb9715d379ad2d358b831360620883fbbfa0d6 (patch)
tree9b13e063b3009688edc984bc5bb9db223a151f1b
parentacb76b32c3effc2b013b0213161df0edfb51a70b (diff)
downloadorg.eclipse.sirius-77fb9715d379ad2d358b831360620883fbbfa0d6.tar.gz
org.eclipse.sirius-77fb9715d379ad2d358b831360620883fbbfa0d6.tar.xz
org.eclipse.sirius-77fb9715d379ad2d358b831360620883fbbfa0d6.zip
[510040] Fix potential NPEs
Async blocks can be called later than expected, at a time when the editor has already been disposed and some fields set to null. Bug: 510040 Change-Id: Ib871c29de4c734861d0e9b215e0c8733659f7864 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/internal/graphicalcomponents/GraphicalSemanticModelsHandler.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/internal/graphicalcomponents/GraphicalSemanticModelsHandler.java b/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/internal/graphicalcomponents/GraphicalSemanticModelsHandler.java
index d5a5e53538..0ccec5a4f1 100644
--- a/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/internal/graphicalcomponents/GraphicalSemanticModelsHandler.java
+++ b/plugins/org.eclipse.sirius.ui.editor/src/org/eclipse/sirius/ui/editor/internal/graphicalcomponents/GraphicalSemanticModelsHandler.java
@@ -1062,7 +1062,7 @@ public class GraphicalSemanticModelsHandler implements SessionListener, SessionM
@Override
public void run() {
- if (!treeViewer.getTree().isDisposed()) {
+ if (treeViewer != null && !treeViewer.getTree().isDisposed()) {
treeViewer.refresh();
ISelection selection = treeViewer.getSelection();
if (selection.isEmpty()) {
@@ -1080,7 +1080,7 @@ public class GraphicalSemanticModelsHandler implements SessionListener, SessionM
@Override
public void run() {
- if (!treeViewer.getTree().isDisposed()) {
+ if (treeViewer != null && !treeViewer.getTree().isDisposed()) {
treeViewer.refresh();
siriusCommonContentModelProvider.addRefreshViewerTrigger(updated);
}

Back to the top