From 9e6b2a12650c5a6d24be3de8c078d31e7548750e Mon Sep 17 00:00:00 2001 From: "yuhong0206@sina.cn" Date: Mon, 29 Mar 2021 08:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96excel=E5=A2=9E=E5=8A=A0=20if(?= =?UTF-8?q?row=20=3D=3D=20null)=20{=20=20=20=20=20continue;=20}=20?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E3=80=82=E9=98=B2=E6=AD=A2=E6=9C=89=E6=97=B6?= =?UTF-8?q?=E5=80=99Excel=E8=A1=A8=E4=B8=AD=E6=9C=89=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=8C=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E6=97=B6=E5=87=BA=E7=8E=B0=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index dcba68e..15612b9 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -229,6 +229,10 @@ public class ExcelUtil { // 从第2行开始取数据,默认第一行是表头. Row row = sheet.getRow(i); + if(row == null) + { + continue; + } T entity = null; for (Map.Entry entry : fieldsMap.entrySet()) {