Andreas Schaefer created SLING-7020:
---------------------------------------
Summary: 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
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)