diff --git a/src/main/java/org/dynmap/AsynchronousQueue.java b/src/main/java/org/dynmap/AsynchronousQueue.java index 8b9a854e..30e6781d 100644 --- a/src/main/java/org/dynmap/AsynchronousQueue.java +++ b/src/main/java/org/dynmap/AsynchronousQueue.java @@ -30,15 +30,10 @@ public class AsynchronousQueue { private T pop() { synchronized (lock) { - try { - T t = queue.removeFirst(); - if (!set.remove(t)) { - // This should never happen. - } - return t; - } catch (NoSuchElementException e) { - return null; - } + T t = queue.pollFirst(); + if(t != null) + set.remove(t); + return t; } }