[
https://issues.apache.org/jira/browse/NIFI-8266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17297511#comment-17297511
]
Mark Payne commented on NIFI-8266:
----------------------------------
Merged to both main and support/nifi-1.13 branches
> 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
> Assignee: Matt Burgess
> Priority: Major
> Fix For: 1.14.0, 1.13.1
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> 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)