Fix NPE
This commit is contained in:
parent
15fce9ad2c
commit
6dfa078fa7
|
|
@ -26,13 +26,18 @@ public class AdminClaimExpireTask extends BukkitRunnable
|
|||
public void run()
|
||||
{
|
||||
//Config.expiringClaims.entrySet().removeIf(entry -> System.currentTimeMillis() >= entry.getValue());
|
||||
for(Iterator<Map.Entry<Long, Long>> it = Config.expiringClaims.entrySet().iterator(); it.hasNext(); ) {
|
||||
for(Iterator<Map.Entry<Long, Long>> it = Config.expiringClaims.entrySet().iterator(); it.hasNext();)
|
||||
{
|
||||
Map.Entry<Long, Long> entry = it.next();
|
||||
if(System.currentTimeMillis() >= entry.getValue()) {
|
||||
if(System.currentTimeMillis() >= entry.getValue())
|
||||
{
|
||||
Claim claim = plugin.dataStore.getClaim(entry.getKey());
|
||||
plugin.dataStore.deleteClaim(claim, false, true);
|
||||
it.remove();
|
||||
plugin.getLogger().info("Removed temporary admin claim with id " + entry.getKey());
|
||||
if (claim != null)
|
||||
{
|
||||
plugin.dataStore.deleteClaim(claim, false, true);
|
||||
it.remove();
|
||||
plugin.getLogger().info("Removed temporary admin claim with id " + entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user