Merge pull request #233 from speedxx/development

fix npe in /myinfo
This commit is contained in:
super 2020-07-18 19:58:09 -04:00 committed by GitHub
commit fc31babff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -591,14 +591,17 @@ public class FUtil
public static String colorize(String string)
{
Matcher matcher = Pattern.compile("&#[a-f0-9A-F]{6}").matcher(string);
while (matcher.find())
if (string != null)
{
String code = matcher.group().replace("&", "");
string = string.replace("&" + code, net.md_5.bungee.api.ChatColor.of(code) + "");
}
Matcher matcher = Pattern.compile("&#[a-f0-9A-F]{6}").matcher(string);
while (matcher.find())
{
String code = matcher.group().replace("&", "");
string = string.replace("&" + code, net.md_5.bungee.api.ChatColor.of(code) + "");
}
string = ChatColor.translateAlternateColorCodes('&', string);
string = ChatColor.translateAlternateColorCodes('&', string);
}
return string;
}