mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
Fix NPE in BBCodeConverter
Fixes HANGAR-Z
This commit is contained in:
parent
1a59721c2c
commit
3862f3d887
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user