Fixed bug 398515: Add workaround in Debug UI for bug 398776: Workbench
starts IStartup plug-ins before it is fully initialized (was: Race
condition in DebugUIPlugin.start() can cause Debug plugins to not get
loaded properly)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
index 65704a3..b2a9e55 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -549,7 +549,9 @@
 			// initialize for already open windows
 			IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
 			for (int i = 0; i < workbenchWindows.length; i++) {
-				windowOpened(workbenchWindows[i]);
+				if (workbenchWindows[i].getSelectionService() != null) {
+					windowOpened(workbenchWindows[i]);
+				}
 			}
 		}
 		DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);