[ 
https://issues.apache.org/jira/browse/NIFI-8266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17297506#comment-17297506
 ] 

ASF subversion and git services commented on NIFI-8266:
-------------------------------------------------------

Commit 0965523bab370ae3f91c4ea94e7cf750b4601249 in nifi's branch 
refs/heads/main from Matt Burgess
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=0965523 ]

NIFI-8266: Fix NPE when validating supported properties against validation 
context
- Removed schema properties from FreeFormTextRecordSetWriter causing validation 
issues

This closes #4851.

Signed-off-by: Mark Payne <[email protected]>


> 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: 20m
>  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)

Reply via email to