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

    https://github.com/apache/nifi/pull/319#discussion_r59996108
  
    --- Diff: 
nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java
 ---
    @@ -489,17 +546,32 @@ private FlowFile executeActions(final ProcessSession 
session, final ProcessConte
             final Map<String, String> attributesToUpdate = new 
HashMap<>(actions.size());
             final Set<String> attributesToDelete = new 
HashSet<>(actions.size());
     
    +        final Map<String, String> statefulAttributesToSet;
    +
    +        if (statefulAttributes != null){
    +            statefulAttributesToSet = new HashMap<>();
    +        } else {
    +            statefulAttributesToSet = null;
    +        }
    +
    +
             // go through each action
             for (final Action action : actions.values()) {
                 if 
(!action.getAttribute().equals(DELETE_ATTRIBUTES.getName())) {
    --- End diff --
    
    Any possibility of getAttribute() returning null? Just want to avoid 
unnecessary NPE.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to