Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-11-07 11:22:58 -0500
committerIgor Fedorenko2011-11-07 11:22:58 -0500
commit2b455560c1f17e9e5937db18efb24023fee4e506 (patch)
treeb0f23185ecf02ba429a5a8057f816172bba26536
parentfd5f7c4877ca64d5ff580bb30fc698184ed014e1 (diff)
downloadm2e-core-2b455560c1f17e9e5937db18efb24023fee4e506.tar.gz
m2e-core-2b455560c1f17e9e5937db18efb24023fee4e506.tar.xz
m2e-core-2b455560c1f17e9e5937db18efb24023fee4e506.zip
361038 fixed NPE caused by EclipseBuildContext.newScanner
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseBuildContext.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseBuildContext.java
index e7b13fbd..51a0871e 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseBuildContext.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/EclipseBuildContext.java
@@ -16,6 +16,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.util.NLS;
@@ -60,7 +61,8 @@ public class EclipseBuildContext extends AbstractEclipseBuildContext {
public Scanner newScanner(File basedir) {
IPath relpath = getRelativePath(basedir);
if (relpath !=null) {
- return new ResourceScanner(project.findMember(relpath));
+ IResource resource = project.findMember(relpath);
+ return resource != null? new ResourceScanner(resource): new EmptyScanner(basedir);
}
File projectBasedir = getBaseResource().getFullPath().toFile();
addMessage(projectBasedir, -1, -1, NLS.bind(Messages.buildConextFileAccessOutsideOfProjectBasedir, basedir),

Back to the top