EndzeitBegins commented on code in PR #8503:
URL: https://github.com/apache/nifi/pull/8503#discussion_r1539482164


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java:
##########
@@ -340,7 +356,7 @@ protected void getListing(final String path, final int 
depth, final int maxResul
 
                 if (isIncludedFile(entry, symlink) && (filteringDisabled || 
pathMatched)) {
                     if (filteringDisabled || fileFilterPattern == null || 
fileFilterPattern.matcher(entryFilename).matches()) {
-                        listing.add(newFileInfo(entry, path));
+                        listing.add(newFileInfo(path, entry.getName(), 
entry.getAttributes()));

Review Comment:
   Thank you for your feedback @exceptionfactory.
   
   The call to `newFileInfo` is preceded by a call to `isIncludedFile` inside 
the if expression, which in turn calls `.isRegularFile()` on the 
`RemoteResourceInfo entry` passed in. 
   In case the `entry` was `null`, a `NullPointerException` would be thrown 
before reaching `newFileInfo`. 
   
   Thus I figured the null check is not required in `newFileInfo`, but I can 
add an explicit `null` check into the if clause, if that's desired.



-- 
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