477269: NullPointerException in MarketplaceWizardCommand.execute (106)

- Hotfix: just log in case of an error in StatusManager

Bug: 477269
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=477269
diff --git a/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/commands/MarketplaceWizardCommand.java b/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/commands/MarketplaceWizardCommand.java
index 0a164b8..0ab6518 100644
--- a/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/commands/MarketplaceWizardCommand.java
+++ b/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/commands/MarketplaceWizardCommand.java
@@ -103,8 +103,14 @@
 				}
 				IStatus exitStatus = new Status(IStatus.ERROR, MarketplaceClientUi.BUNDLE_ID, cause.getCode(),
 						Messages.MarketplaceWizardCommand_cannotOpenMarketplace, new CoreException(cause));
-				StatusManager.getManager().handle(exitStatus,
-						StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
+				try {
+					StatusManager.getManager().handle(exitStatus,
+							StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
+				} catch (Exception ex) {
+					// HOTFIX for bug 477269 - Display might get disposed during call to handle due to workspace shutdown or similar.
+					// In that case, just log...
+					MarketplaceClientUi.getLog().log(exitStatus);
+				}
 				return null;
 			} else if (!remoteCatalogStatus.isOK()) {
 				StatusManager.getManager().handle(remoteCatalogStatus, StatusManager.LOG);