mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 08:39:49 +01:00
(Hopefully) Fix NPE, delay PurgeTask start for a few seconds just to be
safe.
This commit is contained in:
parent
b554fb342a
commit
f7e56d9833
@ -201,7 +201,7 @@ public class mcMMO extends JavaPlugin {
|
||||
//Old & Powerless User remover
|
||||
int purgeInterval = Config.getInstance().getPurgeInterval();
|
||||
if (purgeInterval == 0) {
|
||||
scheduler.runTask(this, new UserPurgeTask(this));
|
||||
scheduler.scheduleSyncDelayedTask(this, new UserPurgeTask(this), 40); //Start 2 seconds after startup.
|
||||
}
|
||||
else if (purgeInterval > 0) {
|
||||
scheduler.scheduleSyncRepeatingTask(this, new UserPurgeTask(this), 0, purgeInterval * 60L * 60L * 20L);
|
||||
|
@ -41,7 +41,7 @@ public class UserPurgeTask implements Runnable {
|
||||
int userId = Integer.valueOf(userslist.get(i).get(1));
|
||||
HashMap<Integer, ArrayList<String>> username = database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + userId + "'");
|
||||
|
||||
if (Bukkit.getPlayer(username.get(1).get(0)).isOnline()) {
|
||||
if (username != null && Bukkit.getOfflinePlayer(username.get(1).get(0)).isOnline()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user