aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Goubet2013-07-30 05:52:48 (EDT)
committerRobin Stocker2013-08-05 10:42:13 (EDT)
commitda70c4047ea0fd7cdd42a7af800d3876bf8f60da (patch)
tree7bcefec9864987febc6ce907852852d95d00e01f
parentcb94e50dcd5f8f473938a82ba47f43f2a3e487f2 (diff)
downloadegit-da70c4047ea0fd7cdd42a7af800d3876bf8f60da.zip
egit-da70c4047ea0fd7cdd42a7af800d3876bf8f60da.tar.gz
egit-da70c4047ea0fd7cdd42a7af800d3876bf8f60da.tar.bz2
Fix potential NPE from passing null as progress monitorrefs/changes/67/14967/2
Even though the javadoc advertizes it, a few model providers will not accept "null" as a progress monitor. Use the NullProgressMonitor instead to be on the safe side. Change-Id: Ie4aa950b970297185b0488adadfc791d429eb364 Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr> Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
index fc0e426..0d362ee 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/util/ResourceUtil.java
@@ -31,6 +31,7 @@ import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.project.RepositoryMapping;
@@ -213,7 +214,7 @@ public class ResourceUtil {
// get mappings from model provider if there are matching resources
final ModelProvider model = candidate.getModelProvider();
final ResourceMapping[] modelMappings = model.getMappings(
- file, context, null);
+ file, context, new NullProgressMonitor());
for (ResourceMapping mapping : modelMappings)
mappings.add(mapping);
}