Skip to content

Commit b979d78

Browse files
committed
1 优化
1 parent 32a3177 commit b979d78

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

common/src/main/java/pro/tools/file/ToolFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,9 @@ public static List<File> listFilesInDirWithFilter(File dir, String suffix, boole
707707
return null;
708708
}
709709
File[] files = dir.listFiles();
710-
List<File> list = Lists.newArrayListWithCapacity(files.length);
710+
List<File> list = null;
711711
if (files != null && files.length != 0) {
712+
list = Lists.newArrayListWithCapacity(files.length);
712713
for (File file : files) {
713714
if (file.getName().toUpperCase().endsWith(suffix.toUpperCase())) {
714715
list.add(file);

0 commit comments

Comments
 (0)