Fixed NPE
This commit is contained in:
parent
1c2b373bd7
commit
c452c1a375
1 changed files with 4 additions and 1 deletions
|
@ -9,6 +9,8 @@ import java.util.UUID;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.palmergames.bukkit.towny.Towny;
|
import com.palmergames.bukkit.towny.Towny;
|
||||||
import com.palmergames.bukkit.towny.object.Resident;
|
import com.palmergames.bukkit.towny.object.Resident;
|
||||||
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
||||||
|
@ -438,7 +440,8 @@ public class TBMCPlayer implements AutoCloseable {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
if (!Bukkit.getPlayer(uuid).isOnline())
|
final Player player = Bukkit.getPlayer(uuid);
|
||||||
|
if (player == null || !player.isOnline())
|
||||||
getLoadedPlayers().remove(uuid);
|
getLoadedPlayers().remove(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue