[
https://issues.apache.org/jira/browse/NIFI-5145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470946#comment-16470946
]
ASF GitHub Bot commented on NIFI-5145:
--------------------------------------
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2672#discussion_r187425793
--- Diff:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java
---
@@ -268,7 +268,7 @@ protected WriteConcern getWriteConcern(final
ProcessContext context) {
protected void writeBatch(String payload, FlowFile parent,
ProcessContext context, ProcessSession session,
Map<String, String> extraAttributes, Relationship rel) throws
UnsupportedEncodingException {
String charset = parent != null ?
context.getProperty(CHARSET).evaluateAttributeExpressions(parent).getValue()
--- End diff --
@MikeThomsen I may be wrong but i think this is supposed to be getting rid
of the check for `parent != null`, isn't it? As-is, it's saying if parent !=
null then evaluate with parent flowfile, otherwise still evaluate with parent
flowfile... should just be `String charset =
context.getProperty(charset).evaluateAttributeExpressions(parent).getValue()`,
no?
> MockPropertyValue.evaluateExpressionLanguage(FlowFile) cannot handle null
> inputs
> --------------------------------------------------------------------------------
>
> Key: NIFI-5145
> URL: https://issues.apache.org/jira/browse/NIFI-5145
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Mike Thomsen
> Assignee: Mike Thomsen
> Priority: Major
>
> The method mentioned in the title line cannot handle null inputs, even though
> the main NiFi execution classes can handle that scenario. This forces hack to
> pass testing with nulls that looks like this:
> String val = flowFile != null ?
> context.getProperty(PROP).evaluateExpressionLanguage(flowfile).getValue() :
> context.getProperty(PROP).evaluateExpressionLanguage(new
> HashMap()).getValue();
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)