Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2122#discussion_r138642556
  
    --- Diff: 
nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/paths/WildcardIndexPath.java
 ---
    @@ -67,7 +67,9 @@
                         return IntStream.range(0, array.length)
                             .mapToObj(index -> {
                                 final DataType elementDataType = 
((ArrayDataType) fieldValue.getField().getDataType()).getElementType();
    -                            final RecordField elementField = new 
RecordField(fieldValue.getField().getFieldName() + "[" + index + "]", 
elementDataType);
    +                            final RecordField elementField = 
elementDataType.getFieldType() == RecordFieldType.RECORD
    --- End diff --
    
    This is not related to the NPE issue. It's related to my earlier comment 
about updating arrays of simple fields. Right now, if you try to update an 
array that does not contain records, it won't do anything because of the field 
name we're giving here. If you think that should be a separated JIRA and/or 
addressed differently, let me know. (I added a unit test to update an array of 
integers)


---

Reply via email to