Ignore NuSuchElementExceptions when removing channel handlers.

This commit is contained in:
Kristian S. Stangeland 2014-05-21 23:04:29 +02:00
parent 8067799306
commit 1141c0ba71

View File

@ -3,6 +3,7 @@ package com.comphenix.tinyprotocol;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
@ -204,7 +205,11 @@ public abstract class TinyProtocol {
// Remove channel handler
serverChannel.eventLoop().execute(new Runnable() {
public void run() {
pipeline.remove(serverChannelHandler);
try {
pipeline.remove(serverChannelHandler);
} catch (NoSuchElementException e) {
// That's fine
}
}
});
}