Bug 574729 - avoid calling System::setSecurityManager with null

Change-Id: I22b97871a6348c76ee48a380bf48670dd81aa9b4
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/182992
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java
index a8ac8f2..4db708a 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java
@@ -176,7 +176,9 @@
 		if (configuration.getDebug().DEBUG_SECURITY)
 			Debug.println("Setting SecurityManager to: " + toInstall); //$NON-NLS-1$
 		try {
-			System.setSecurityManager(toInstall);
+			if (toInstall != null) {
+				System.setSecurityManager(toInstall);
+			}
 		} catch (UnsupportedOperationException e) {
 			throw new UnsupportedOperationException(
 					"Setting the security manager is not allowed. The java.security.manager=allow java property must be set.", //$NON-NLS-1$