Fix NPE on incorrect world chat color & correct in config

This commit is contained in:
Tim Ekl 2011-11-23 19:32:52 -06:00
parent 9a7c6202cc
commit 06f53a0b47

View File

@ -214,7 +214,14 @@ public class MVWorld implements MultiverseWorld {
public String getColoredWorldString() {
EnglishChatColor worldColor = ((ColorConfigProperty) this.getKnownProperty("color")).getValue();
String alias = ((StringConfigProperty) this.getKnownProperty("alias")).getValue();
if (worldColor.getColor() == null) {
if (worldColor == null) {
try {
this.setProperty("color", "WHITE");
} catch(PropertyDoesNotExistException e) {
// Do nothing - fixing the config file just failed, but we can recover anyway
}
return alias + ChatColor.WHITE;
} else if (worldColor.getColor() == null) {
return alias + ChatColor.WHITE;
}
if (alias.length() == 0) {