[ 
https://issues.apache.org/jira/browse/SLING-7020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16100033#comment-16100033
 ] 

Timothee Maret edited comment on SLING-7020 at 7/25/17 1:28 PM:
----------------------------------------------------------------

This could be reproduced, by adding a configuration for a service resource 
provider factory (PID 
{{org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory}})
 of kind {{trigger}}.


was (Author: marett):
This could be reproduced, by adding a configuration for a service resource 
provider factory (PID {{     
org.apache.sling.distribution.resources.impl.DistributionServiceResourceProviderFactory}})
 of kind {{trigger}}.

> DefaultDistributionComponentProvider is causing an NPE when agents are listed
> -----------------------------------------------------------------------------
>
>                 Key: SLING-7020
>                 URL: https://issues.apache.org/jira/browse/SLING-7020
>             Project: Sling
>          Issue Type: Bug
>          Components: Content Distribution
>         Environment: Latest Sling, JDK 1.8
>            Reporter: Andreas Schaefer
>            Assignee: Timothee Maret
>             Fix For: Content Distribution Core 0.2.10
>
>
> When listing the agents with ' /libs/sling/distribution/services.1.json' then 
> the DefaultDistributionComponentProvider.getComponents() throws an NPE on 
> line 84. The reason is that the method getComponentMap() for type TRIGGER is 
> returning NULL and there is no check for a NPE. This will fix that NPE:
>     public List<DistributionComponent<?>> 
> getComponents(DistributionComponentKind kind) {
>         Map<String, DistributionComponent<?>> componentMap = 
> getComponentMap(kind.asClass());
>         List<DistributionComponent<?>> componentList = new 
> ArrayList<DistributionComponent<?>>();
>         if(componentMap != null) {
>             componentList.addAll(componentMap.values());
>         }
>         return componentList;
>     }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to