mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-10-05 19:17:48 +02:00
Fix NPE on incorrect world chat color & correct in config
This commit is contained in:
parent
9a7c6202cc
commit
06f53a0b47
@ -214,7 +214,14 @@ public class MVWorld implements MultiverseWorld {
|
|||||||
public String getColoredWorldString() {
|
public String getColoredWorldString() {
|
||||||
EnglishChatColor worldColor = ((ColorConfigProperty) this.getKnownProperty("color")).getValue();
|
EnglishChatColor worldColor = ((ColorConfigProperty) this.getKnownProperty("color")).getValue();
|
||||||
String alias = ((StringConfigProperty) this.getKnownProperty("alias")).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;
|
return alias + ChatColor.WHITE;
|
||||||
}
|
}
|
||||||
if (alias.length() == 0) {
|
if (alias.length() == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user