summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (JBoss)2013-04-27 01:12:42 (EDT)
committerPascal Rapicault2013-04-27 01:12:42 (EDT)
commit0b2981ef36bbf088646379929949a377cf58e74d (patch)
treeb4569a91460031fad9c2d4da2d2eaddbb51fc8aa
parentb714eb834bfb24ae9ce6968bc1a55524bde55e4f (diff)
downloadrt.equinox.p2-0b2981ef36bbf088646379929949a377cf58e74d.zip
rt.equinox.p2-0b2981ef36bbf088646379929949a377cf58e74d.tar.gz
rt.equinox.p2-0b2981ef36bbf088646379929949a377cf58e74d.tar.bz2
Handle NPE when the user hit cancel while updates are initially searched
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/UpdateAction.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/UpdateAction.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/UpdateAction.java
index 7736b06..eb7e600 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/UpdateAction.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/UpdateAction.java
@@ -26,6 +26,7 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.*;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.window.Window;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.statushandlers.StatusManager;
@@ -75,6 +76,9 @@ public class UpdateAction extends ExistingIUInProfileAction {
if (operation.getResolutionResult() == Status.OK_STATUS)
return ui.openUpdateWizard(skipSelectionPage, (UpdateOperation) operation, null);
+ if (!operation.hasResolved())
+ return Window.CANCEL;
+
final RemediationOperation remediationOperation = new RemediationOperation(getSession(), (ProfileChangeRequest) operation.getProfileChangeRequest());
ProvisioningJob job = new ProvisioningJob("Searching alternate solutions...", getSession()) {
@Override
@@ -96,6 +100,6 @@ public class UpdateAction extends ExistingIUInProfileAction {
});
getProvisioningUI().schedule(job, StatusManager.SHOW | StatusManager.LOG);
- return 1;
+ return Window.CANCEL;
}
}