pvillard31 commented on a change in pull request #5249:
URL: https://github.com/apache/nifi/pull/5249#discussion_r681593124



##########
File path: 
nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-standard-record-utils/src/main/java/org/apache/nifi/csv/CSVUtils.java
##########
@@ -274,7 +275,12 @@ private static CSVFormat buildCustomFormat(final 
PropertyContext context, final
         final Character quoteChar = getCharUnescaped(context, QUOTE_CHAR, 
variables);
         format = format.withQuote(quoteChar);
 
-        final Character escapeChar = getCharUnescaped(context, ESCAPE_CHAR, 
variables);
+        final Character escapeChar;
+        if 
(context.getProperty(CSVUtils.ESCAPE_CHAR).evaluateAttributeExpressions(variables).getValue().isEmpty())
 {
+            escapeChar = null;
+        } else {
+            escapeChar = getCharUnescaped(context, ESCAPE_CHAR, variables);
+        }

Review comment:
       Would the below be easier to read?
   
   ```suggestion
           final Character escapeChar = 
context.getProperty(CSVUtils.ESCAPE_CHAR).evaluateAttributeExpressions(variables).getValue().isEmpty()
 ? null : getCharUnescaped(context, ESCAPE_CHAR, variables);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to