File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
invui/src/main/java/xyz/xenondevs/invui/internal/network Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,14 @@ private void injectChannelHandler(Player player) {
109109 private void removeChannelHandler (Player player ) {
110110 packetHandlers .remove (player .getUniqueId ());
111111 var channel = ((CraftPlayer ) player ).getHandle ().connection .connection .channel ;
112- channel .pipeline ().remove (invuiPacketHandlerName );
112+
113+ try {
114+ channel .pipeline ().remove (invuiPacketHandlerName );
115+ } catch (NoSuchElementException ignored ) {
116+ // On server shutdown, the handler may have already been removed.
117+ // Checking whether the handler is still present before removing it
118+ // could cause a race condition, so we just catch the exception instead.
119+ }
113120 }
114121
115122 private static class PacketHandler extends ChannelDuplexHandler {
You can’t perform that action at this time.
0 commit comments