FELIX-5205 eliminate obvious source of IllegalStateException in dto fetching

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1734367 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java b/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
index 3d8c140..3ba1752 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java
@@ -342,17 +342,24 @@
 		{
 			return null;
 		}
-		Bundle bundle = bundleContext.getBundle();
-		if (bundle == null)
-		{
-			return null;
-		}
-		BundleDTO b = new BundleDTO();
-		b.id = bundle.getBundleId();
-		b.lastModified = bundle.getLastModified();
-		b.state = bundle.getState();
-		b.symbolicName = bundle.getSymbolicName();
-		b.version = bundle.getVersion().toString();
-		return b;
+		try
+        {
+            Bundle bundle = bundleContext.getBundle();
+            if (bundle == null)
+            {
+                return null;
+            }
+            BundleDTO b = new BundleDTO();
+            b.id = bundle.getBundleId();
+            b.lastModified = bundle.getLastModified();
+            b.state = bundle.getState();
+            b.symbolicName = bundle.getSymbolicName();
+            b.version = bundle.getVersion().toString();
+            return b;
+        }
+        catch (IllegalStateException e)
+        {
+            return null;
+        }
 	}
 }