You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/10/12 13:53:16 UTC

[GitHub] [incubator-seatunnel] EricJoy2048 commented on a diff in pull request #3063: [Fix] fix may cause error when listFiles return null

EricJoy2048 commented on code in PR #3063:
URL: https://github.com/apache/incubator-seatunnel/pull/3063#discussion_r993495468


##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/FileUtils.java:
##########
@@ -105,20 +105,20 @@ public static Long getFileLineNumber(@NonNull String filePath) {
      */
     public static Long getFileLineNumberFromDir(@NonNull String dirPath) {
         File file = new File(dirPath);
-        Long value = null;
         if (file.isDirectory()) {
-            value = Arrays.stream(file.listFiles()).map(currFile -> {
+            File[] files = file.listFiles();
+            if (files == null) {
+                return 0L;
+            }
+            return Arrays.stream(file.listFiles()).map(currFile -> {

Review Comment:
   done



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org