From 7bd7e4f8d61fb4c3e95e3fd4da22d210e4e9a68d Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Fri, 11 Oct 2019 12:38:07 +0200 Subject: [PATCH] HTTPServer: fix possible NullReference, fix Pool.Stop() call --- HTTPServer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HTTPServer.cs b/HTTPServer.cs index 8886b7d..ec33347 100644 --- a/HTTPServer.cs +++ b/HTTPServer.cs @@ -104,9 +104,10 @@ namespace ln.http } foreach (HTTPServerConnection connection in HTTPServerConnection.CurrentConnections) - connection.Abort(); + connection?.Abort(); - threadPool.Stop(true); + if (threadPool.State == PoolState.RUN) + threadPool.Stop(true); } private void AcceptConnections(TcpListener tcpListener)