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