fix null registeredTemplate in cache
@@ -206,10 +206,12 @@ public class NiFiTemplateCache {
if (cachedProperties == null || templateDTO.getTimestamp().getTime() > cachedProperties.getLastUpdated()) {
List<NifiProperty> properties = nifiRestClient.getPropertiesForTemplate(templateDTO, includePropertyDescriptors);
Map<String,List<NifiFlowCacheBaseProcessorDTO>> inputProcessorRelations = new NiFiTemplateCacheProcessorGraph(templateDTO).build();
- if (cachedProperties == null && registeredTemplate != null ) {
+ if (cachedProperties == null ) {
cachedProperties = new TemplatePropertiesCache(templateDTO.getId(), includePropertyDescriptors, templateDTO.getTimestamp().getTime());
+ if(registeredTemplate != null){
templatePropertiesCache.put(cacheKey, cachedProperties);
}
+ }
if (registeredTemplate != null) {
//merge in the saved state of the template
NifiPropertyUtil.matchAndSetPropertyByProcessorName(properties, registeredTemplate.getProperties(),
