avoid possible NPE when closing connection wizard
authordadubrow
Tue, 11 Aug 2009 11:35:59 -0500
changeset 405 068dfaa49bcc
parent 403 154ecf9c9186
child 406 ceccd65fff3e
avoid possible NPE when closing connection wizard
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnectedService.java
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnectedService.java	Tue Aug 11 10:31:32 2009 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnectedService.java	Tue Aug 11 11:35:59 2009 -0500
@@ -26,6 +26,7 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jface.operation.IRunnableContext;
 import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Display;
 
 import java.lang.reflect.InvocationTargetException;
@@ -178,7 +179,7 @@
 			return;
 			
 		final TestResult result[] = { null };
-		if (runnableContext != null) {
+		if (runnableContext != null && (!(runnableContext instanceof WizardDialog) || ((WizardDialog) runnableContext).getShell() != null)) {
 			Display.getDefault().syncExec(new Runnable() {
 				public void run() {
 					try {