diff --git a/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java b/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java index 650176a9f6..5adb29fc41 100644 --- a/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/AbstractIssuePlatform.java @@ -234,6 +234,9 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform { // ![中心主题.png](/resource/md/get/a0b19136_中心主题.png) -> String regex = "(\\!\\[.*?\\]\\((.*?)\\))"; Pattern pattern = Pattern.compile(regex); + if (StringUtils.isBlank(input)) { + return ""; + } Matcher matcher = pattern.matcher(input); String result = ""; while (matcher.find()) { @@ -250,6 +253,9 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform { protected String removeImage(String input) { String regex = "(\\!\\[.*?\\]\\((.*?)\\))"; + if (StringUtils.isBlank(input)) { + return ""; + } Matcher matcher = Pattern.compile(regex).matcher(input); while (matcher.find()) { matcher.group(); @@ -262,6 +268,9 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform { // -> ![中心主题.png](/resource/md/get/a0b19136_中心主题.png) String regex = "()"; Pattern pattern = Pattern.compile(regex); + if (StringUtils.isBlank(input)) { + return ""; + } Matcher matcher = pattern.matcher(input); String result = input; while (matcher.find()) { @@ -281,6 +290,9 @@ public abstract class AbstractIssuePlatform implements IssuesPlatform { List files = new ArrayList<>(); String regex = "(\\!\\[.*?\\]\\((.*?)\\))"; Pattern pattern = Pattern.compile(regex); + if (StringUtils.isBlank(input)) { + return new ArrayList<>(); + } Matcher matcher = pattern.matcher(input); while (matcher.find()) { try {