Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2006-01-26 02:15:50 +0000
committerMichael Valenta2006-01-26 02:15:50 +0000
commitc8d3be2990aa58195a82056dee60e3d22d40f460 (patch)
treea3dd19f2799dddb1cfcdaf21e366baf8712dbddf
parentfda23580bd07367d6b8ab8427732452546cb2b4a (diff)
downloadeclipse.platform.team-c8d3be2990aa58195a82056dee60e3d22d40f460.tar.gz
eclipse.platform.team-c8d3be2990aa58195a82056dee60e3d22d40f460.tar.xz
eclipse.platform.team-c8d3be2990aa58195a82056dee60e3d22d40f460.zip
Added null check
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CreatePatchAction.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CreatePatchAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CreatePatchAction.java
index 82ec68a2d..cef912d29 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CreatePatchAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CreatePatchAction.java
@@ -47,22 +47,24 @@ public class CreatePatchAction extends CVSModelProviderAction {
for (Iterator iter = selection.iterator(); iter.hasNext();) {
Object element = iter.next();
ResourceMapping mapping = Utils.getResourceMapping(element);
- ResourceTraversal[] traversals = mapping.getTraversals(ResourceMappingContext.LOCAL_CONTEXT, null);
- final IResourceDiffTree diffTree = getContext().getDiffTree();
- diffTree.accept(new IDiffVisitor() {
- public boolean visit(IDiffNode delta) throws CoreException {
- IResource resource = diffTree.getResource(delta);
- if (resource.getType() == IResource.FILE && delta instanceof IThreeWayDiff) {
- IThreeWayDiff twd = (IThreeWayDiff) delta;
- IDiffNode local = twd.getLocalChange();
- if (local != null && local.getKind() != IDiffNode.NO_CHANGE) {
- resources.add(resource);
+ if (mapping != null) {
+ ResourceTraversal[] traversals = mapping.getTraversals(ResourceMappingContext.LOCAL_CONTEXT, null);
+ final IResourceDiffTree diffTree = getContext().getDiffTree();
+ diffTree.accept(new IDiffVisitor() {
+ public boolean visit(IDiffNode delta) throws CoreException {
+ IResource resource = diffTree.getResource(delta);
+ if (resource.getType() == IResource.FILE && delta instanceof IThreeWayDiff) {
+ IThreeWayDiff twd = (IThreeWayDiff) delta;
+ IDiffNode local = twd.getLocalChange();
+ if (local != null && local.getKind() != IDiffNode.NO_CHANGE) {
+ resources.add(resource);
+ }
}
+ return true;
}
- return true;
- }
-
- }, traversals);
+
+ }, traversals);
+ }
}
return (IResource[]) resources.toArray(new IResource[resources.size()]);
}

Back to the top