Fix NPE in BBCodeConverter

Fixes HANGAR-Z
This commit is contained in:
Nassim Jahnke 2023-04-22 23:07:56 +02:00
parent 1a59721c2c
commit 3862f3d887
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -44,7 +44,7 @@ public class BBCodeConverter {
REPLACERS.put("img", (tag, tagArg, content) -> "![" + content + "](" + content + ")");
REPLACERS.put("media", (tag, tagArg, content) -> "youtube".equals(tagArg) ? "@[YouTube](https://youtu.be/" + content + ")" : null);
REPLACERS.put("size", (tag, tagArg, content) -> {
if (content.isBlank()) {
if (content.isBlank() || tagArg == null) {
return content;
}
@ -332,6 +332,9 @@ public class BBCodeConverter {
}
private static String removeQuotes(final String s) {
if (s == null) {
return "";
}
if (s.length() > 2) {
final char c = s.charAt(0);
if ((c == '\'' || c == '"') && c == s.charAt(s.length() - 1)) {