Small bug fixes.

This commit is contained in:
Kristian S. Stangeland 2012-09-30 00:25:04 +02:00
parent 711990fa15
commit c77103246e
3 changed files with 4 additions and 3 deletions

View File

@ -92,7 +92,7 @@ public class ProtocolLibrary extends JavaPlugin {
private void createAsyncTask(Server server) {
try {
if (asyncPacketTask < 0)
if (asyncPacketTask >= 0)
throw new IllegalStateException("Async task has already been created");
// Attempt to create task

View File

@ -1,5 +1,6 @@
package com.comphenix.protocol.async;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@ -177,7 +178,8 @@ public class AsyncFilterManager implements AsynchronousManager {
@Override
public boolean hasAsynchronousListeners(PacketEvent packet) {
return getProcessingQueue(packet).getListener(packet.getPacketID()).size() > 0;
Collection<?> list = getProcessingQueue(packet).getListener(packet.getPacketID());
return list != null && list.size() > 0;
}
/**

View File

@ -8,7 +8,6 @@ import org.bukkit.plugin.Plugin;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.events.PacketListener;
import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
/**
* Represents a handler for an asynchronous event.