Browse Source

modify isEmpty(Object array)

修复判空异常
Liang Long 5 years ago
parent
commit
1ef749bf38
1 changed files with 6 additions and 5 deletions
  1. 6 5
      hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java

+ 6 - 5
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java

@@ -66,12 +66,13 @@ public class ArrayUtil {
 	 * @return 是否为空
 	 * @return 是否为空
 	 */
 	 */
 	public static boolean isEmpty(Object array) {
 	public static boolean isEmpty(Object array) {
-		if (null == array) {
-			return true;
-		} else if (isArray(array)) {
-			return 0 == Array.getLength(array);
+		if (array != null) {
+			if (isArray(array)) {
+				return 0 == Array.getLength(array);
+			}
+			return false;
 		}
 		}
-		throw new UtilException("Object to provide is not a Array !");
+		return true;		
 	}
 	}
 
 
 	/**
 	/**