Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-01-11 18:04:47 +0000
committerMichael Valenta2007-01-11 18:04:47 +0000
commitfd3482c98e700b63c57b6a146d4a20dcdabf8916 (patch)
tree5c2429ca806bf3b67c2fdd57c7abda4c9539063b
parent8025cb7c6c5136b2898327471d2a10bc3fd9d2a5 (diff)
downloadeclipse.platform.team-fd3482c98e700b63c57b6a146d4a20dcdabf8916.tar.gz
eclipse.platform.team-fd3482c98e700b63c57b6a146d4a20dcdabf8916.tar.xz
eclipse.platform.team-fd3482c98e700b63c57b6a146d4a20dcdabf8916.zip
Bug 169858 NPE after Override and Update
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java8
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java8
2 files changed, 12 insertions, 4 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index d58c86012..7c158daaa 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -146,15 +146,19 @@ public class StructureDiffViewer extends DiffTreeViewer {
}
private IStructureComparator createStructure(IProgressMonitor monitor) {
+ // Defend against concurrent disposal
+ Object input = fInput;
+ if (input == null)
+ return null;
if (fStructureCreator instanceof IStructureCreator2) {
IStructureCreator2 sc2 = (IStructureCreator2) fStructureCreator;
try {
- return sc2.createStructure(fInput, monitor);
+ return sc2.createStructure(input, monitor);
} catch (CoreException e) {
CompareUIPlugin.log(e);
}
}
- return fStructureCreator.getStructure(fInput);
+ return fStructureCreator.getStructure(input);
}
public void dispose() {
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index d58c86012..7c158daaa 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -146,15 +146,19 @@ public class StructureDiffViewer extends DiffTreeViewer {
}
private IStructureComparator createStructure(IProgressMonitor monitor) {
+ // Defend against concurrent disposal
+ Object input = fInput;
+ if (input == null)
+ return null;
if (fStructureCreator instanceof IStructureCreator2) {
IStructureCreator2 sc2 = (IStructureCreator2) fStructureCreator;
try {
- return sc2.createStructure(fInput, monitor);
+ return sc2.createStructure(input, monitor);
} catch (CoreException e) {
CompareUIPlugin.log(e);
}
}
- return fStructureCreator.getStructure(fInput);
+ return fStructureCreator.getStructure(input);
}
public void dispose() {

Back to the top