Brian Ghigiarelli created NIFI-476:
--------------------------------------

             Summary: EvaluateJsonPath fails with NullPointerException on null 
values
                 Key: NIFI-476
                 URL: https://issues.apache.org/jira/browse/NIFI-476
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 0.0.2, 0.1.0
            Reporter: Brian Ghigiarelli


The EvaluateJsonPath processor fails with a NullPointerException when the input 
JSON has a null value in the contents of a field it is evaluating.
{code:none}
Caused by: java.lang.NullPointerException
        at 
org.apache.nifi.processors.standard.AbstractJsonPathProcessor.getResultRepresentation(AbstractJsonPathProcessor.java:84)
        at 
org.apache.nifi.processors.standard.EvaluateJsonPath.onTrigger(EvaluateJsonPath.java:268)
        at 
org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
{code}

null is a valid value in the [JSON spec|http://www.json.org/]

The current spec of EvaluateJsonPath from NIFI-360 indicated that any missing 
fields should be given an empty string attribute value in the output flow file 
sent to "match".

null values should either follow this same pattern, or perhaps allow for null 
values in the output FlowFile attributes to properly indicate the difference 
between null and an empty String.  Either way, EvaluateJsonProcessor should 
handle null input values instead of throwing exceptions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to