aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-09-10 23:37:51 -0400
committerGerrit Code Review @ Eclipse.org2018-09-10 23:37:51 -0400
commit921d74065ed0737709c3ecdc4dff133e1f195f65 (patch)
tree1771e26534c5b989306622e55fe5aee3016cd8c7
parent2e357f4913c24b7ed8be32247ed585db45a8d323 (diff)
parentcee8183a00701aa8cc07d4cf226d2c31b2870f20 (diff)
downloadegit-921d74065ed0737709c3ecdc4dff133e1f195f65.tar.gz
egit-921d74065ed0737709c3ecdc4dff133e1f195f65.tar.xz
egit-921d74065ed0737709c3ecdc4dff133e1f195f65.zip
Merge "More null checks in GitResourceVariantTreeSubscriber"
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java
index b6f35b057..5420c1f62 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriber.java
@@ -127,7 +127,13 @@ public class GitResourceVariantTreeSubscriber extends
return new IResource[0];
}
GitSynchronizeData gsd = gsds.getData(res.getProject());
+ if (gsd == null) {
+ return new IResource[0];
+ }
Repository repo = gsd.getRepository();
+ if (repo == null) {
+ return new IResource[0];
+ }
GitSyncObjectCache repoCache = cache.get(repo);
Collection<IResource> allMembers = new ArrayList<>();
@@ -198,7 +204,7 @@ public class GitResourceVariantTreeSubscriber extends
}
// not refreshing the workspace, locate and collect target resources
- Map<GitSynchronizeData, Collection<String>> updateRequests = new HashMap<GitSynchronizeData, Collection<String>>();
+ Map<GitSynchronizeData, Collection<String>> updateRequests = new HashMap<>();
for (IResource resource : resources) {
IProject project = resource.getProject();
GitSynchronizeData data = gsds.getData(project.getName());
@@ -209,7 +215,7 @@ public class GitResourceVariantTreeSubscriber extends
if (mapping != null) {
Collection<String> paths = updateRequests.get(data);
if (paths == null) {
- paths = new ArrayList<String>();
+ paths = new ArrayList<>();
updateRequests.put(data, paths);
}
@@ -574,9 +580,9 @@ public class GitResourceVariantTreeSubscriber extends
@Override
protected SyncInfo getSyncInfo(IResource local, IResourceVariant base,
IResourceVariant remote) throws TeamException {
-
- Repository repo = gsds.getData(local.getProject()).getRepository();
- return getSyncInfo(local, base, remote, repo);
+ GitSynchronizeData data = gsds.getData(local.getProject());
+ Repository repo = data != null ? data.getRepository() : null;
+ return repo != null ? getSyncInfo(local, base, remote, repo) : null;
}
/**