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:27:01 UTC

[jira] [Assigned] (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:all-tabpanel ]

Timothee Maret reassigned SLING-7020:
-------------------------------------

    Assignee: Timothee Maret

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