mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixed null pointers for getUUID
This commit is contained in:
parent
d0876c60b0
commit
e0adcb3b60
@ -63,6 +63,10 @@ import java.util.UUID;
|
|||||||
} else {
|
} else {
|
||||||
uuid = UUIDHandler.getUUID(args[1]);
|
uuid = UUIDHandler.getUUID(args[1]);
|
||||||
}
|
}
|
||||||
|
if (uuid == null) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.INVALID_PLAYER, args[1]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!plot.denied.contains(uuid)) {
|
if (!plot.denied.contains(uuid)) {
|
||||||
if (plot.owner == uuid) {
|
if (plot.owner == uuid) {
|
||||||
PlayerFunctions.sendMessage(plr, C.ALREADY_OWNER);
|
PlayerFunctions.sendMessage(plr, C.ALREADY_OWNER);
|
||||||
|
@ -62,6 +62,10 @@ import java.util.UUID;
|
|||||||
} else {
|
} else {
|
||||||
uuid = UUIDHandler.getUUID(args[1]);
|
uuid = UUIDHandler.getUUID(args[1]);
|
||||||
}
|
}
|
||||||
|
if (uuid == null) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.INVALID_PLAYER, args[1]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!plot.helpers.contains(uuid)) {
|
if (!plot.helpers.contains(uuid)) {
|
||||||
if (plot.owner == uuid) {
|
if (plot.owner == uuid) {
|
||||||
PlayerFunctions.sendMessage(plr, C.ALREADY_OWNER);
|
PlayerFunctions.sendMessage(plr, C.ALREADY_OWNER);
|
||||||
|
@ -219,7 +219,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
private String getPlayerName(final UUID uuid) {
|
private String getPlayerName(final UUID uuid) {
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
return uuid.toString();
|
return "unknown";
|
||||||
}
|
}
|
||||||
if (uuid.equals(DBFunc.everyone) || uuid.toString().equalsIgnoreCase(DBFunc.everyone.toString())) {
|
if (uuid.equals(DBFunc.everyone) || uuid.toString().equalsIgnoreCase(DBFunc.everyone.toString())) {
|
||||||
return "everyone";
|
return "everyone";
|
||||||
|
@ -71,7 +71,15 @@ import java.util.UUID;
|
|||||||
|
|
||||||
for (final PlotId id : plots) {
|
for (final PlotId id : plots) {
|
||||||
final Plot current = PlotMain.getPlots(world).get(id);
|
final Plot current = PlotMain.getPlots(world).get(id);
|
||||||
current.owner = getUUID(args[0]);
|
|
||||||
|
UUID uuid = getUUID(args[0]);
|
||||||
|
|
||||||
|
if (uuid == null) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.INVALID_PLAYER, args[1]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
current.owner = uuid;
|
||||||
PlotMain.updatePlot(current);
|
PlotMain.updatePlot(current);
|
||||||
DBFunc.setOwner(current, current.owner);
|
DBFunc.setOwner(current, current.owner);
|
||||||
|
|
||||||
|
@ -63,6 +63,10 @@ import java.util.UUID;
|
|||||||
} else {
|
} else {
|
||||||
uuid = UUIDHandler.getUUID(args[1]);
|
uuid = UUIDHandler.getUUID(args[1]);
|
||||||
}
|
}
|
||||||
|
if (uuid == null) {
|
||||||
|
PlayerFunctions.sendMessage(plr, C.INVALID_PLAYER, args[1]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!plot.trusted.contains(uuid)) {
|
if (!plot.trusted.contains(uuid)) {
|
||||||
if (plot.owner == uuid) {
|
if (plot.owner == uuid) {
|
||||||
PlayerFunctions.sendMessage(plr, C.ALREADY_OWNER);
|
PlayerFunctions.sendMessage(plr, C.ALREADY_OWNER);
|
||||||
|
@ -51,7 +51,11 @@ public class list extends SubCommand {
|
|||||||
* String name = Bukkit.getOfflinePlayer(id).getName(); if (name ==
|
* String name = Bukkit.getOfflinePlayer(id).getName(); if (name ==
|
||||||
* null) { return "none"; } return name;
|
* null) { return "none"; } return name;
|
||||||
*/
|
*/
|
||||||
return UUIDHandler.getName(id);
|
String name = UUIDHandler.getName(id);
|
||||||
|
if (name == null) {
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user