diff --git a/hutool-core/src/main/java/org/dromara/hutool/core/collection/CollUtil.java b/hutool-core/src/main/java/org/dromara/hutool/core/collection/CollUtil.java index d2fbb372c..e21fe7afc 100644 --- a/hutool-core/src/main/java/org/dromara/hutool/core/collection/CollUtil.java +++ b/hutool-core/src/main/java/org/dromara/hutool/core/collection/CollUtil.java @@ -397,6 +397,10 @@ public class CollUtil { * @return 单差集 */ public static Collection subtract(final Collection coll1, final Collection coll2) { + if(isEmpty(coll1) || isEmpty(coll2)){ + return coll1; + } + Collection result = ObjUtil.clone(coll1); if (null == result) { result = CollUtil.create(coll1.getClass());