From 3c1f251b88c8b893898cc9076910bcc02fa92139 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Mon, 4 Jun 2018 23:02:14 +0800 Subject: [PATCH] =?UTF-8?q?:cry:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E5=A4=87?= =?UTF-8?q?=E4=BB=BD=E6=97=B6=EF=BC=8C=E5=A4=87=E4=BB=BD=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cc/ryanc/halo/utils/HaloUtils.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/cc/ryanc/halo/utils/HaloUtils.java b/src/main/java/cc/ryanc/halo/utils/HaloUtils.java index 5732a6c29..e2466c4e8 100755 --- a/src/main/java/cc/ryanc/halo/utils/HaloUtils.java +++ b/src/main/java/cc/ryanc/halo/utils/HaloUtils.java @@ -124,18 +124,20 @@ public class HaloUtils { List backupDtos = new ArrayList<>(); BackupDto backupDto = null; //้ๅކๆ–‡ไปถ - for (File file : files) { - if (file.isFile()) { - if (StringUtils.equals(file.getName(), ".DS_Store")) { - continue; + if(null != files){ + for (File file : files) { + if (file.isFile()) { + if (StringUtils.equals(file.getName(), ".DS_Store")) { + continue; + } + backupDto = new BackupDto(); + backupDto.setFileName(file.getName()); + backupDto.setCreateAt(getCreateTime(file.getAbsolutePath())); + backupDto.setFileType(FileUtil.getType(file)); + backupDto.setFileSize(parseSize(file.length())); + backupDto.setBackupType(dir); + backupDtos.add(backupDto); } - backupDto = new BackupDto(); - backupDto.setFileName(file.getName()); - backupDto.setCreateAt(getCreateTime(file.getAbsolutePath())); - backupDto.setFileType(FileUtil.getType(file)); - backupDto.setFileSize(parseSize(file.length())); - backupDto.setBackupType(dir); - backupDtos.add(backupDto); } } return backupDtos;