mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Fixed some NPEs
This commit is contained in:
parent
97c452e311
commit
49bf3b6694
@ -99,7 +99,7 @@ public class Info extends SubCommand {
|
||||
}
|
||||
|
||||
private String getPlayerList(ArrayList<UUID> l) {
|
||||
if ((l == null) || (l.size() < 1)) {
|
||||
if (l == null || l.size() < 1) {
|
||||
return " none";
|
||||
}
|
||||
String c = C.PLOT_USER_LIST.s();
|
||||
@ -122,7 +122,7 @@ public class Info extends SubCommand {
|
||||
return "everyone";
|
||||
}
|
||||
OfflinePlayer plr = Bukkit.getOfflinePlayer(uuid);
|
||||
if (plr == null) {
|
||||
if (plr.getName() == null) {
|
||||
return "unknown";
|
||||
}
|
||||
return plr.getName();
|
||||
|
@ -69,7 +69,7 @@ public class TP extends SubCommand {
|
||||
|
||||
private Plot isAlias(World world, String a) {
|
||||
int index = 0;
|
||||
if (a.contains(":")) {
|
||||
if (a.contains(";")) {
|
||||
String[] split = a.split(";");
|
||||
if (split[1].length()>0 && StringUtils.isNumeric(split[1])) {
|
||||
index = Integer.parseInt(split[1]);
|
||||
|
@ -97,7 +97,11 @@ public class list extends SubCommand {
|
||||
if (id == null) {
|
||||
return "none";
|
||||
}
|
||||
return Bukkit.getOfflinePlayer(id).getName();
|
||||
String name = Bukkit.getOfflinePlayer(id).getName();
|
||||
if (name == null) {
|
||||
return "none";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
private String getArgumentList(String[] strings) {
|
||||
|
@ -83,9 +83,9 @@ import com.intellectualcrafters.plot.events.PlayerLeavePlotEvent;
|
||||
public class PlayerEvents implements Listener {
|
||||
|
||||
private String getName(UUID uuid) {
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
|
||||
String player = Bukkit.getOfflinePlayer(uuid).getName();
|
||||
if (player != null) {
|
||||
return player.getName();
|
||||
return player;
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user