file empty return true

This commit is contained in:
Looly
2021-05-18 18:16:01 +08:00
parent 510ec621a2
commit e5049baa92
2 changed files with 2 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
* 【core 】 BeanUtil.copyToList增加重载pr#321@Gitee
* 【core 】 SyncFinisher增加stop方法issue#1578@Github
* 【cache 】 CacheObj默认方法改为protectedissue#I3RIEI@Gitee
* 【core 】 FileUtil.isEmpty不存在时返回trueissue#1582@Github
### 🐞Bug修复
* 【core 】 修复XmlUtil中omitXmlDeclaration参数无效问题issue#1581@Github

View File

@@ -127,7 +127,7 @@ public class FileUtil extends PathUtil {
* @return 是否为空当提供非目录时返回false
*/
public static boolean isEmpty(File file) {
if (null == file) {
if (null == file || false == file.exists()) {
return true;
}