diff options
author | Andrey Loskutov | 2016-12-02 10:40:58 +0000 |
---|---|---|
committer | Pascal Rapicault | 2017-01-10 14:53:47 +0000 |
commit | 13316c2392ea48644a2776f51af8be6ffe8aa045 (patch) | |
tree | 490dcaf8208515d3a532ca06e80f0792c7a1d749 | |
parent | 2a32a28ce58410413c26caeddbb741cdc7a5db41 (diff) | |
download | rt.equinox.p2-13316c2392ea48644a2776f51af8be6ffe8aa045.tar.gz rt.equinox.p2-13316c2392ea48644a2776f51af8be6ffe8aa045.tar.xz rt.equinox.p2-13316c2392ea48644a2776f51af8be6ffe8aa045.zip |
Bug 508593 - NPE in AutomaticUpdater.sameProfile
Change-Id: Ie87b44f50faeb87518d776de920325451a086a91
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java index eb25a48a8..77ebd59e5 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java @@ -71,10 +71,16 @@ public class AutomaticUpdater implements IUpdateListener { boolean sameProfile(String another) { if (another.equals(IProfileRegistry.SELF)) { - another = getProfileRegistry().getProfile(another).getProfileId(); + IProfile profile = getProfileRegistry().getProfile(another); + if (profile != null) { + another = profile.getProfileId(); + } } if (profileId.equals(IProfileRegistry.SELF)) { - profileId = getProfileRegistry().getProfile(profileId).getProfileId(); + IProfile profile = getProfileRegistry().getProfile(profileId); + if (profile != null) { + profileId = profile.getProfileId(); + } } return profileId.equals(another); } @@ -175,12 +181,14 @@ public class AutomaticUpdater implements IUpdateListener { ArrayList<IInstallableUnit> list = new ArrayList<IInstallableUnit>(iusWithUpdates.size()); IProfile profile = getProfileRegistry().getProfile(profileId); - for (IInstallableUnit iuWithUpdate : iusWithUpdates) { - try { - if (validToUpdate(profile, iuWithUpdate)) - list.add(iuWithUpdate); - } catch (OperationCanceledException e) { - // Nothing to report + if (profile != null) { + for (IInstallableUnit iuWithUpdate : iusWithUpdates) { + try { + if (validToUpdate(profile, iuWithUpdate)) + list.add(iuWithUpdate); + } catch (OperationCanceledException e) { + // Nothing to report + } } } iusWithUpdates = list; |