You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Burgess (Jira)" <ji...@apache.org> on 2021/02/26 16:02:00 UTC

[jira] [Updated] (NIFI-8266) InvokeScriptedProcessor can throw NPE during custom property validation

     [ https://issues.apache.org/jira/browse/NIFI-8266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Burgess updated NIFI-8266:
-------------------------------
    Status: Patch Available  (was: In Progress)

> 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
>          Time Spent: 10m
>  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)