mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-30 22:23:54 +01:00
Potential NPE
This commit is contained in:
parent
3f85a1e5c2
commit
9d950b9b4a
@ -21,7 +21,7 @@ public class AsyncronousQuit {
|
|||||||
|
|
||||||
protected AuthMe plugin;
|
protected AuthMe plugin;
|
||||||
protected DataSource database;
|
protected DataSource database;
|
||||||
protected Player p;
|
protected Player player;
|
||||||
protected Utils utils = Utils.getInstance();
|
protected Utils utils = Utils.getInstance();
|
||||||
private String name;
|
private String name;
|
||||||
private ItemStack[] armor = null;
|
private ItemStack[] armor = null;
|
||||||
@ -33,7 +33,7 @@ public class AsyncronousQuit {
|
|||||||
|
|
||||||
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database,
|
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database,
|
||||||
boolean isKick) {
|
boolean isKick) {
|
||||||
this.p = p;
|
this.player = p;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.database = database;
|
this.database = database;
|
||||||
this.name = p.getName().toLowerCase();
|
this.name = p.getName().toLowerCase();
|
||||||
@ -41,7 +41,8 @@ public class AsyncronousQuit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void process() {
|
public void process() {
|
||||||
final Player player = p;
|
if (player == null)
|
||||||
|
return;
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -64,6 +65,7 @@ public class AsyncronousQuit {
|
|||||||
inv = limbo.getInventory();
|
inv = limbo.getInventory();
|
||||||
armor = limbo.getArmour();
|
armor = limbo.getArmour();
|
||||||
}
|
}
|
||||||
|
if (limbo.getGroup() != null && !limbo.getGroup().equals(""))
|
||||||
utils.addNormal(player, limbo.getGroup());
|
utils.addNormal(player, limbo.getGroup());
|
||||||
needToChange = true;
|
needToChange = true;
|
||||||
isOp = limbo.getOperator();
|
isOp = limbo.getOperator();
|
||||||
@ -94,6 +96,7 @@ public class AsyncronousQuit {
|
|||||||
database.setUnlogged(name);
|
database.setUnlogged(name);
|
||||||
}
|
}
|
||||||
AuthMePlayerListener.gameMode.remove(name);
|
AuthMePlayerListener.gameMode.remove(name);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, inv, armor, isOp, isFlying, needToChange));
|
final Player p = player;
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, p, inv, armor, isOp, isFlying, needToChange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user