From 0994f92669fbb0b9ac4239ff212d53629ead635b Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Wed, 17 Jul 2024 10:03:08 +0000 Subject: [PATCH] FIX: Don't crash server links when recieving a K line for an unknown client --- server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index da07726..6c304d4 100755 --- a/server.py +++ b/server.py @@ -330,7 +330,9 @@ Please note that this is not network level statistics.\n""".encode( break case "K": cName = buffer[2:] - if G.clientsConnected[cName.lower()] == G.remoteID: + if not G.clientsConnected.get(cName.lower(), False): + pass # They don't exist, safe to ignore + elif G.clientsConnected[cName.lower()] == G.remoteID: G.killList[cName.lower()] = True else: G.servers[G.clientsConnected[cName.lower()]][ @@ -510,7 +512,9 @@ async def connectServer(hostname: str, port: int): break case "K": cName = buffer[2:] - if G.clientsConnected[cName.lower()] == G.remoteID: + if not G.clientsConnected.get(cName.lower(), False): + pass # They don't exist, safe to ignore + elif G.clientsConnected[cName.lower()] == G.remoteID: G.killList[cName.lower()] = True else: G.servers[G.clientsConnected[cName.lower()]][