only receive if listening

This commit is contained in:
Pilzinsel64
2024-11-18 15:29:51 +01:00
parent 93e8cf3219
commit 25c6aa4c30

View File

@@ -80,6 +80,7 @@ public class ApiServer(string apiUrl) : IApiServer
protected void Receive() protected void Receive()
{ {
if (httpListener.IsListening)
httpListener?.BeginGetContext(ListenerCallback, null); httpListener?.BeginGetContext(ListenerCallback, null);
} }