tjwatson commented on code in PR #172:
URL: https://github.com/apache/felix-dev/pull/172#discussion_r978575369


##########
scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java:
##########
@@ -117,6 +117,10 @@ public Collection<ComponentConfigurationDTO> 
getComponentConfigurationDTOs(Compo
         try
         {
             ComponentHolder<?> holder = getHolderFromDescription( description);
+            // the holder can also be null if the associated component is 
deregistered

Review Comment:
   If null is allowed to be returned here then I think we need null checks in 
all 4 locations it is called:
   
   `disableComponent(ComponentDescriptionDTO)`
   `enableComponent(ComponentDescriptionDTO)`
   `getComponentConfigurationDTOs(ComponentDescriptionDTO)`
   `isComponentEnabled(ComponentDescriptionDTO)`
   
   Also, looking at `getHolderFromDescription(ComponentDescriptionDTO 
description)` I think it has an issue where it could get called on an 
uninstalled bundle in which case `Bundle b = context.getBundle(bundleId);` will 
result in a `null` value in `b` causing an NPE also.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@felix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to