Fixed NPE

This commit is contained in:
Robin Kupper
2011-10-18 10:47:11 +02:00
parent 2c571575d6
commit a93475772e

View File

@@ -43,9 +43,8 @@ public class LogBlock extends JavaPlugin
private Updater updater = null; private Updater updater = null;
private Timer timer = null; private Timer timer = null;
private PermissionHandler permissions = null; private PermissionHandler permissions = null;
private boolean errorAtLoading = false; private boolean errorAtLoading = false, connected = true;
private final Map<String, Session> sessions = new HashMap<String, Session>(); private final Map<String, Session> sessions = new HashMap<String, Session>();
private boolean connected = true;
public Config getLBConfig() { public Config getLBConfig() {
return config; return config;
@@ -264,7 +263,7 @@ public class LogBlock extends JavaPlugin
if (timer != null) if (timer != null)
timer.cancel(); timer.cancel();
getServer().getScheduler().cancelTasks(this); getServer().getScheduler().cancelTasks(this);
if (config.logPlayerInfo) if (config.logPlayerInfo && getServer().getOnlinePlayers() != null)
for (final Player player : getServer().getOnlinePlayers()) for (final Player player : getServer().getOnlinePlayers())
consumer.queueLeave(player); consumer.queueLeave(player);
if (consumer != null && consumer.getQueueSize() > 0) { if (consumer != null && consumer.getQueueSize() > 0) {