diff options
author | Sergey Prigogin | 2016-08-30 19:50:54 +0000 |
---|---|---|
committer | Sergey Prigogin | 2016-08-30 19:50:54 +0000 |
commit | c14eec0caf5ce84e5d9bd461c20f95cc1ffb6367 (patch) | |
tree | 7755bcfe0e668a72189de9980b0668ffee969256 | |
parent | ab6c4729ea853f7e4e1c5952eabdee3e41dcddaf (diff) | |
download | rt.equinox.p2-c14eec0caf5ce84e5d9bd461c20f95cc1ffb6367.tar.gz rt.equinox.p2-c14eec0caf5ce84e5d9bd461c20f95cc1ffb6367.tar.xz rt.equinox.p2-c14eec0caf5ce84e5d9bd461c20f95cc1ffb6367.zip |
Bug 461102 - NPE in OperationFactory.listInstalledElementsY20160915-1000Y20160908-1000Y20160901-1000I20160915-0230I20160915-0200I20160914-2300I20160914-2000I20160914-0800I20160914-0430I20160914-0030I20160913-2000I20160913-0800I20160912-2000I20160912-1005I20160912-0800I20160912-0430I20160912-0225I20160912-0140I20160911-2015I20160906-0800
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.java | 8 |
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); |