You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2018/12/20 21:20:51 UTC

[GitHub] Xsixteen commented on a change in pull request #3229: NIFI-5894 FTPTransfer NullPointerException

Xsixteen commented on a change in pull request #3229: NIFI-5894  FTPTransfer NullPointerException
URL: https://github.com/apache/nifi/pull/3229#discussion_r243421437
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java
 ##########
 @@ -296,13 +296,19 @@ private FileInfo newFileInfo(final FTPFile file, String path) {
         perms.append(file.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.READ_PERMISSION) ? "r" : "-");
         perms.append(file.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.WRITE_PERMISSION) ? "w" : "-");
         perms.append(file.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.EXECUTE_PERMISSION) ? "x" : "-");
+	
+	long lastModifiedTime		= System.currentTimeMillis();
+
+	if(file.getTimestamp() != null) {
+		lastModifiedTime 	= file.getTimestamp().getTimeInMillis();
+	}
 
         FileInfo.Builder builder = new FileInfo.Builder()
             .filename(file.getName())
             .fullPathFileName(newFullForwardPath)
             .directory(file.isDirectory())
             .size(file.getSize())
-            .lastModifiedTime(file.getTimestamp().getTimeInMillis())
+            .lastModifiedTime(lastModifiedTime)
 
 Review comment:
   I agree that 0 should be the modified timestamp as it cannot be known.
   I have updated the code to utilize the ternary statement check as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services