From ae10bb701a8e74a241494df23284b720607a222f Mon Sep 17 00:00:00 2001 From: Florent Date: Sat, 6 Dec 2025 19:35:57 +0100 Subject: [PATCH] deal with error_code not in payload for scope error --- src/meshcore_cli/meshcore_cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index f18346f..d251b73 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -1604,8 +1604,11 @@ async def set_scope (mc, scope) : return scope res = await mc.commands.set_flood_scope(scope) - if res is None or res.type == EventType.ERROR: - if not res is None and res.payload["error_code"] == 1: #unsupported + if res is None : + return None + + if res.type == EventType.ERROR: + if "error_code" in res.payload and res.payload["error_code"] == 1: #unsupported set_scope.has_scope = False return None