From dbabc781433277a607cf12d71c5489c422dbba8f Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Wed, 20 Dec 2023 14:54:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5=E7=94=A8=E6=88=B7=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=A9=BA=E9=97=B4=E5=90=8D=E7=A7=B0=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=AF=BC=E5=85=A5=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1033309 --user=王旭 【系统设置】github#27781 导入用户工作空间名称是空时导入报错提示优化 https://www.tapd.cn/55049933/s/1446090 --- .../io/metersphere/excel/listener/UserDataListener.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system-setting/backend/src/main/java/io/metersphere/excel/listener/UserDataListener.java b/system-setting/backend/src/main/java/io/metersphere/excel/listener/UserDataListener.java index 6f4d08b4a0..f86a29a5d4 100644 --- a/system-setting/backend/src/main/java/io/metersphere/excel/listener/UserDataListener.java +++ b/system-setting/backend/src/main/java/io/metersphere/excel/listener/UserDataListener.java @@ -150,6 +150,9 @@ public class UserDataListener extends EasyExcelListener { private String checkWorkSpace(String userRoleInExcel, String workspaceInfoInExcel) { String result = null; if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) { + if(StringUtils.isBlank(workspaceInfoInExcel)){ + return result; + } String[] workspaceArr = workspaceInfoInExcel.split(StringUtils.LF); for (String workspace : workspaceArr) { @@ -175,6 +178,9 @@ public class UserDataListener extends EasyExcelListener { private String checkProject(String userGroupInExcel, String projectInfoInExcel) { String result = null; if (StringUtils.equalsAnyIgnoreCase(Translator.get("options_yes"), userGroupInExcel)) { + if(StringUtils.isBlank(projectInfoInExcel)){ + return result; + } String[] projectNameArr = projectInfoInExcel.split(StringUtils.LF); for (String projectName : projectNameArr) { if (!projectNameMap.containsKey(projectName)) { @@ -200,6 +206,9 @@ public class UserDataListener extends EasyExcelListener { private List getIdByExcelInfoAndIdDic(String userRoleInExcel, String nameStringInExce, Map idDic) { List resultList = new ArrayList<>(); if (StringUtils.equalsIgnoreCase(Translator.get("options_yes"), userRoleInExcel)) { + if(StringUtils.isBlank(nameStringInExce)){ + return resultList; + } String[] nameArr = nameStringInExce.split(StringUtils.LF); for (String name : nameArr) { if (idDic.containsKey(name)) {