diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java index 414a3f5b897..710bdf165f4 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java @@ -128,6 +128,9 @@ private void showWhitespace() { for (int i = 0; i < viewers.length; i++) { if (fNeedsPainters[i]) { MergeSourceViewer viewer = viewers[i]; + if (viewer == null) { + continue; + } SourceViewer sourceViewer = viewer.getSourceViewer(); WhitespaceCharacterPainter painter; if (fStore != null) { diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java index 512ce1d5a9b..70391621dfe 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TextEditorPropertyAction.java @@ -77,8 +77,14 @@ public void run() { } public void dispose() { - if (store != null) + if (viewers != null) { + for (int i = 0; i < viewers.length; i++) { + viewers[i] = null; + } + } + if (store != null) { store.removePropertyChangeListener(this); + } } /**