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)) {