Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-03-09 21:50:21 -0500
committerIgor Fedorenko2011-03-09 21:50:21 -0500
commitaa508686c8a384b6b34bd6e7e0256efaaa5fb177 (patch)
treea95d775f055e95c5d8ea47c63ab870c793f51f7a /org.eclipse.m2e.discovery/src
parent0a8c31a8dad598aa922c138832ab83681fd5e980 (diff)
downloadm2e-core-aa508686c8a384b6b34bd6e7e0256efaaa5fb177.tar.gz
m2e-core-aa508686c8a384b6b34bd6e7e0256efaaa5fb177.tar.xz
m2e-core-aa508686c8a384b6b34bd6e7e0256efaaa5fb177.zip
fixed NPE running discovery UTs from eclipse
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.discovery/src')
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
index 0d9f8fa3..60c392ec 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscoveryService.java
@@ -237,13 +237,17 @@ public class MavenDiscoveryService implements IImportWizardPageFactory, IMavenDi
* Returns true if all IUs specified in the catalog item are installed in the profile
*/
public boolean itemInstalled(IProfile profile, CatalogItem item, IProgressMonitor monitor) {
+ if(profile == null) {
+ return false;
+ }
+
List<IQuery<IInstallableUnit>> queries = new ArrayList<IQuery<IInstallableUnit>>();
for(String iuId : item.getInstallableUnits()) {
queries.add(QueryUtil.createIUQuery(iuId));
}
- IQueryResult<IInstallableUnit> result = profile.query(QueryUtil.createCompoundQuery(queries, false), monitor);
+ IQueryResult<IInstallableUnit> result = profile.query(QueryUtil.createCompoundQuery(queries, true), monitor);
return !result.isEmpty();
}

Back to the top