You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Timothee Maret (JIRA)" <ji...@apache.org> on 2017/07/25 13:29:00 UTC

[jira] [Comment Edited] (SLING-7020) DefaultDistributionComponentProvider is causing an NPE when agents are listed

    [ 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)