Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-05-23 13:43:59 +0000
committerMichael Valenta2007-05-23 13:43:59 +0000
commit8c43e3b482afa9c63a72a1fef19c4e00e5998082 (patch)
tree6fdc5ef4445ea45f8a8ba2d6bba8bfd2e6bd690a /bundles/org.eclipse.compare
parent46dfa5cc93e4ac6a9970b383404ec2f06bd1beed (diff)
downloadeclipse.platform.team-8c43e3b482afa9c63a72a1fef19c4e00e5998082.tar.gz
eclipse.platform.team-8c43e3b482afa9c63a72a1fef19c4e00e5998082.tar.xz
eclipse.platform.team-8c43e3b482afa9c63a72a1fef19c4e00e5998082.zip
Bug 187365 NPE trying to exclude part of a patch
Diffstat (limited to 'bundles/org.eclipse.compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java7
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java7
2 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index c8e842c22..374c5d88e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -571,14 +571,17 @@ public class Patcher {
FileDiff file = hunk.getParent();
disabledElements.remove(file);
DiffProject project = file.getProject();
- disabledElements.remove(project);
+ if (project != null)
+ disabledElements.remove(project);
} else {
disabledElements.add(hunk);
FileDiff file = hunk.getParent();
if (disabledElements.containsAll(Arrays.asList(file.getHunks()))) {
disabledElements.add(file);
DiffProject project = file.getProject();
- if (disabledElements.containsAll(Arrays.asList(project.getFileDiffs())))
+ if (project != null
+ && disabledElements.containsAll(Arrays.asList(project
+ .getFileDiffs())))
disabledElements.add(project);
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index c8e842c22..374c5d88e 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -571,14 +571,17 @@ public class Patcher {
FileDiff file = hunk.getParent();
disabledElements.remove(file);
DiffProject project = file.getProject();
- disabledElements.remove(project);
+ if (project != null)
+ disabledElements.remove(project);
} else {
disabledElements.add(hunk);
FileDiff file = hunk.getParent();
if (disabledElements.containsAll(Arrays.asList(file.getHunks()))) {
disabledElements.add(file);
DiffProject project = file.getProject();
- if (disabledElements.containsAll(Arrays.asList(project.getFileDiffs())))
+ if (project != null
+ && disabledElements.containsAll(Arrays.asList(project
+ .getFileDiffs())))
disabledElements.add(project);
}
}

Back to the top