Add null check to cached type lookups

This commit is contained in:
Colin McDonald 2016-07-17 17:06:53 -04:00
parent 612fe880dc
commit 57729c17e0
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ public final class Rank {
}
public static Rank findById(String id) {
return rankIdCache.get(id.toLowerCase());
return id == null ? null : rankIdCache.get(id.toLowerCase());
}
static {

View File

@ -39,7 +39,7 @@ public final class Server {
}
public static Server findById(String id) {
return serverIdCache.get(id.toLowerCase());
return id == null ? null : serverIdCache.get(id.toLowerCase());
}
static {

View File

@ -37,7 +37,7 @@ public final class ServerGroup {
}
public static ServerGroup findById(String id) {
return serverGroupIdCache.get(id.toLowerCase());
return id == null ? null : serverGroupIdCache.get(id.toLowerCase());
}
public static ServerGroup findDefault() {