From 72749fbf933268ad777ee22b564635184068a629 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 9 Jul 2021 11:02:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=8C=E6=AD=A5=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/issue/AbstractIssuePlatform.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 {