From 8760b53a0a4cbcab9ed0135088548c2d3e1245bd Mon Sep 17 00:00:00 2001 From: Myles Date: Wed, 30 Mar 2016 17:45:24 +0100 Subject: [PATCH] Fix Disconnect Issue (It's not really harmful but still) --- src/main/java/us/myles/ViaVersion/ViaIdleThread.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/us/myles/ViaVersion/ViaIdleThread.java b/src/main/java/us/myles/ViaVersion/ViaIdleThread.java index 1a45dee76..3791ab607 100644 --- a/src/main/java/us/myles/ViaVersion/ViaIdleThread.java +++ b/src/main/java/us/myles/ViaVersion/ViaIdleThread.java @@ -34,9 +34,13 @@ public class ViaIdleThread extends BukkitRunnable { long nextIdleUpdate = info.get(MovementTracker.class).getNextIdlePacket(); if (nextIdleUpdate <= System.currentTimeMillis()) { ChannelHandlerContext context = PipelineUtil.getContextBefore("decoder", info.getChannel().pipeline()); - context.fireChannelRead(idlePacket); + if(info.getChannel().isOpen()) { + if (context != null) { + context.fireChannelRead(idlePacket); - info.get(MovementTracker.class).incrementIdlePacket(); + info.get(MovementTracker.class).incrementIdlePacket(); + } + } } } }