Matt Burgess created NIFI-8266:
----------------------------------

             Summary: InvokeScriptedProcessor can throw NPE during custom 
property validation
                 Key: NIFI-8266
                 URL: https://issues.apache.org/jira/browse/NIFI-8266
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
            Reporter: Matt Burgess


If a script in InvokeScriptedProcessor (ISP) specifies additional properties to 
be added to the configuration dialog, a NullPointerException can occur during 
validation:



This appears to be the result of the ValidationContext for the ISP being 
created before the script is loaded, and thus the properties are not present in 
the context during validation. However the list iterated over in 
AbstractConfigurableComponent.validate() is the list of supported property 
descriptors, which may or may not include the script's properties when 
validate() is called.

The list to be iterated over should be the list of properties in the 
ValidationContext, to avoid an NPE. Having said that, for components that can 
provide properties dynamically (via script, e.g.) the ValidationContext should 
be recreated rather than reusing the first one created. This could be 
accomplished with a component annotation (ProvidesCustomProperties or 
something). If the annotation exists for the component, the ValidationContext 
should be recreated before validation; otherwise, the first one created should 
be retained for performance purposes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to