fix: Check for empty messages before checking its properties in MuxRPCAPI

This commit is contained in:
Gergely Polonkai 2023-11-02 06:15:17 +01:00
parent 6ddb8bc8d3
commit 01e8de96b2
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -159,11 +159,11 @@ class MuxRPCAPI:
"""Continuously process incoming messages"""
async for req_message in self.connection:
body = req_message.body
if req_message is None:
return
body = req_message.body
if isinstance(body, dict) and body.get("name"):
self.process(self.connection, MuxRPCRequest.from_message(req_message))