sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothee Maret (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SLING-7020) DefaultDistributionComponentProvider is causing an NPE when agents are listed
Date Tue, 25 Jul 2017 13:31:04 GMT

     [ https://issues.apache.org/jira/browse/SLING-7020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Timothee Maret resolved SLING-7020.
-----------------------------------
    Resolution: Fixed

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

Mime
View raw message