From dc72aa702b5f24bb54d668e8ac0fcfa593b6c328 Mon Sep 17 00:00:00 2001
From: jkerdreux-imt <jerome.kerdreux@imt-atlantique.fr>
Date: Mon, 16 Dec 2024 01:43:17 +0100
Subject: [PATCH] Fix a bug which occurs for devices w/ no Attributes

While hunting to fix pyright errors, I introduced this nasty bug.
Device w/ no attributes will not answer to get_attributes, which is
right but not mandatory and introduce edge case in tools.
---
 libs/lib/xaal/lib/engine.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libs/lib/xaal/lib/engine.py b/libs/lib/xaal/lib/engine.py
index 1a5fc608..4c6ec7fc 100644
--- a/libs/lib/xaal/lib/engine.py
+++ b/libs/lib/xaal/lib/engine.py
@@ -25,8 +25,6 @@ import typing
 from enum import Enum
 from typing import Optional
 
-
-
 from .config import config
 from . import core
 from .exceptions import CallbackError, MessageParserError, XAALError
@@ -135,11 +133,11 @@ class Engine(core.EngineMixin):
                 * error returned on the xAAL bus
         """
         if msg.action is None:
-            return # should not happen, but pyright need this check
+            return  # should not happen, but pyright need this check
 
         try:
             result = run_action(msg, target)
-            if result:
+            if result is not None:
                 self.send_reply(dev=target, targets=[msg.source], action=msg.action, body=result)
         except CallbackError as e:
             self.send_error(target, e.code, e.description)
-- 
GitLab