Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2016-08-30 19:50:54 +0000
committerSergey Prigogin2016-08-30 19:50:54 +0000
commitc14eec0caf5ce84e5d9bd461c20f95cc1ffb6367 (patch)
tree7755bcfe0e668a72189de9980b0668ffee969256
parentab6c4729ea853f7e4e1c5952eabdee3e41dcddaf (diff)
downloadrt.equinox.p2-I20160914-2300.tar.gz
rt.equinox.p2-I20160914-2300.tar.xz
rt.equinox.p2-I20160914-2300.zip
Change-Id: I3bfff65bdcd579398434c1a19c1642be5d2f34c0 Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/OperationFactory.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/OperationFactory.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/OperationFactory.java
index e5769a594..c016de25b 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/OperationFactory.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/OperationFactory.java
@@ -123,14 +123,18 @@ public class OperationFactory {
}
/**
- * Return the {@link IInstallableUnit} that are installed in the running instance of eclipse.
+ * Returns the {@link IInstallableUnit}s that are installed in the running instance of Eclipse.
+ *
* @param rootsOnly set to true to return only the elements that have been explicitly installed (aka roots).
* @param monitor the progress monitor
- * @return the installable units installed
+ * @return the installable units installed, or an empty result if the installation profile of the running system
+ * cannot be accessed
*/
public IQueryResult<IInstallableUnit> listInstalledElements(boolean rootsOnly, IProgressMonitor monitor) {
IProfileRegistry registry = (IProfileRegistry) getAgent().getService(IProfileRegistry.SERVICE_NAME);
IProfile profile = registry.getProfile(IProfileRegistry.SELF);
+ if (profile == null)
+ return new CollectionResult<IInstallableUnit>(null);
if (rootsOnly)
return profile.query(new UserVisibleRootQuery(), monitor);
return profile.query(QueryUtil.ALL_UNITS, monitor);

Back to the top