From 4ef5f9a2a25186d0a55b46ae22046c4924727d47 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Thu, 26 Sep 2024 00:25:46 +1200 Subject: [PATCH] fix to support using shared instance from older rns version --- meshchat.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meshchat.py b/meshchat.py index c155d17..3ef1f05 100644 --- a/meshchat.py +++ b/meshchat.py @@ -1111,12 +1111,14 @@ async def index(request): interface_stats["transport_id"] = interface_stats["transport_id"].hex() # ensure probe_responder is hex as json_response can't serialize bytes - if "probe_responder" in interface_stats: + if "probe_responder" in interface_stats and interface_stats["probe_responder"] is not None: interface_stats["probe_responder"] = interface_stats["probe_responder"].hex() # ensure ifac_signature is hex as json_response can't serialize bytes for interface in interface_stats["interfaces"]: - interface["interface_name"] = interface["short_name"] + + if "short_name" in interface: + interface["interface_name"] = interface["short_name"] if "parent_interface_name" in interface and interface["parent_interface_name"] != None: interface["parent_interface_hash"] = interface["parent_interface_hash"].hex()