Defensive access to the reference list.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1493091 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
index 89fb940..fb87a41 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
@@ -598,11 +598,14 @@
// Recompute the matching services.
m_matchingReferences.clear();
- for (ServiceReference reference : tracker.getServiceReferencesList()) {
- TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
- ref = accept(ref);
- if (ref != null) {
- m_matchingReferences.put(reference, ref);
+ final List<ServiceReference> serviceReferencesList = tracker.getServiceReferencesList();
+ if (serviceReferencesList != null) {
+ for (ServiceReference reference : serviceReferencesList) {
+ TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
+ ref = accept(ref);
+ if (ref != null) {
+ m_matchingReferences.put(reference, ref);
+ }
}
}