NIFI-9416: Fixing NPE when updating param context without inheritedParameterContexts (#5553)

This commit is contained in:
Joe Gresock 2021-11-29 11:29:33 -05:00 committed by GitHub
parent d6b6dd1eb4
commit a5581562bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -232,9 +232,11 @@ public class StandardParameterContextDAO implements ParameterContextDAO {
resolveInheritedParameterContexts(parameterContextDto);
final List<ParameterContext> inheritedParameterContexts = new ArrayList<>();
inheritedParameterContexts.addAll(parameterContextDto.getInheritedParameterContexts().stream()
.map(entity -> flowManager.getParameterContextManager().getParameterContext(entity.getComponent().getId()))
.collect(Collectors.toList()));
if (parameterContextDto.getInheritedParameterContexts() != null) {
inheritedParameterContexts.addAll(parameterContextDto.getInheritedParameterContexts().stream()
.map(entity -> flowManager.getParameterContextManager().getParameterContext(entity.getComponent().getId()))
.collect(Collectors.toList()));
}
return inheritedParameterContexts;
}