FIX: Don't crash server links when recieving a K line for an unknown client

This commit is contained in:
Firepup Sixfifty 2024-07-17 10:03:08 +00:00
parent 16b74ece80
commit 0994f92669
Signed by: Firepup650
SSH key fingerprint: SHA256:U0Zp8EhEe3CMqFSrC79CqatzaEiL4sjta80/RSX2XrY

View file

@ -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()]][