From 27d44c290a07a71ea569d34d9f518bce0b269fd8 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 1 Nov 2021 10:27:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pagecount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/alibaba/excel/read/listener/PageReadListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/read/listener/PageReadListener.java b/src/main/java/com/alibaba/excel/read/listener/PageReadListener.java index 5ce3adf8..c692bf10 100644 --- a/src/main/java/com/alibaba/excel/read/listener/PageReadListener.java +++ b/src/main/java/com/alibaba/excel/read/listener/PageReadListener.java @@ -6,6 +6,8 @@ import java.util.function.Consumer; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.util.ListUtils; +import org.apache.commons.collections4.CollectionUtils; + /** * page read listener * @@ -40,7 +42,9 @@ public class PageReadListener implements ReadListener { @Override public void doAfterAllAnalysed(AnalysisContext context) { - consumer.accept(cachedData); + if (CollectionUtils.isNotEmpty(cachedData)) { + consumer.accept(cachedData); + } } }