Null pointer exception catch

This commit is contained in:
cnaude 2017-10-08 22:33:36 -07:00
parent 91920953c6
commit 790a69a485

View File

@ -506,7 +506,13 @@ public class ChatTokenizer {
effectiveName = ""; effectiveName = "";
} }
String translatedColor = DiscordSRV.getPlugin().getColors().get(hex); String translatedColor = DiscordSRV.getPlugin().getColors().get(hex);
String colorCode = ChatColor.translateAlternateColorCodes('&', translatedColor); String colorCode;
try {
colorCode = ChatColor.translateAlternateColorCodes('&', translatedColor);
} catch (Exception ex) {
colorCode = "";
plugin.logDebug(ex.getMessage());
}
if (colorCode == null) { if (colorCode == null) {
colorCode = ""; colorCode = "";
} }