Bug 578382 - getBundle throws exception if eclipse is not running

When the framwork is not running, no attempt is made to resolve
bundles. Instead null is returned.

Change-Id: Idc91cf0a9bc8fc1fdf66e61e24e6cbdddca96091
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.runtime/+/190004
Tested-by: Platform Bot <platform-bot@eclipse.org>
Tested-by: Wim Jongman <wim.jongman@remainsoftware.com>
Reviewed-by: Wim Jongman <wim.jongman@remainsoftware.com>
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
index 714ce10..3f50707 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
@@ -224,6 +224,9 @@
 	}
 
 	public Bundle[] getBundles(String symbolicName, String versionRange) {
+		if(!isRunning()) {
+			return null;
+		}
 		if (Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(symbolicName)) {
 			symbolicName = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).getSymbolicName();
 		}