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

    https://github.com/apache/nifi/pull/2180#discussion_r166001750
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java
 ---
    @@ -221,4 +264,16 @@ protected WriteConcern getWriteConcern(final 
ProcessContext context) {
             }
             return writeConcern;
         }
    +
    +    protected void writeBatch(String payload, FlowFile parent, 
ProcessContext context, ProcessSession session, Map extraAttributes, 
Relationship rel) throws UnsupportedEncodingException {
    +        String charset = parent != null ? 
context.getProperty(CHARSET).evaluateAttributeExpressions(parent).getValue()
    +                : 
context.getProperty(CHARSET).evaluateAttributeExpressions().getValue();
    +
    +        FlowFile flowFile = session.create(parent);
    --- End diff --
    
    Need to check if parent is null before using it in the create. A unit test 
where there is no incoming flow file will illustrate this.


---

Reply via email to