FELIX-3971 fix some NPEs from ScrInfo when components are not active
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1458174 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
index c7ae8b1..3671050 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
@@ -422,6 +422,11 @@
{
if ( lastRefPair == null )
{
+ ServiceTracker<T, RefPair<T>> tracker = getTracker();
+ if (tracker == null) {
+ trackingCount.set( lastRefPairTrackingCount );
+ return Collections.emptyList();
+ }
return getTracker().getTracked( true, trackingCount ).values();
}
else
@@ -522,7 +527,11 @@
public Collection<RefPair<T>> getRefs( AtomicInteger trackingCount )
{
- return getTracker().getTracked( null, trackingCount ).values();
+ ServiceTracker<T, RefPair<T>> tracker = getTracker();
+ if (tracker == null) {
+ return Collections.emptyList();
+ }
+ return tracker.getTracked( null, trackingCount ).values();
}
}
@@ -901,7 +910,7 @@
public Collection<RefPair<T>> getRefs( AtomicInteger trackingCount )
{
- return null;
+ return Collections.emptyList();
}
public boolean isSatisfied()