diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index efec51608..004c63cb0 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -592,7 +592,11 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable final long approxTime) throws IOException { final SocketChannel socketChannel = (SocketChannel) key.channel(); final Attached attached = (Attached) key.attachment(); - if (attached == null) throw new NullPointerException("No attached"); + if (attached == null) { + LOG.info("Closing connection " + socketChannel + ", nothing attached"); + socketChannel.close(); + return; + } TcpSocketChannelEntryWriter entryWriter = attached.entryWriter; if (entryWriter == null) throw new NullPointerException("No entryWriter"); if (entryWriter.isWorkIncomplete()) {