From d6b3563e0d4ecd3da3815cc0d3ceb16ef2fa4032 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Wed, 25 Jun 2025 16:14:48 +0200 Subject: [PATCH] kernelci: api: helper: don't crash when adding artifacts to node Nodes are created with `'artifacts': null`, meaning calling `update()` could lead to an uncaught exception, and therefore a crash. Avoid this situation by ensuring this field is a dict before calling `update()`. Signed-off-by: Arnaud Ferraris --- kernelci/api/helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernelci/api/helper.py b/kernelci/api/helper.py index c157f469aa..3828d5a341 100644 --- a/kernelci/api/helper.py +++ b/kernelci/api/helper.py @@ -559,6 +559,8 @@ def submit_results(self, results, root): root_node = root.copy() root_node['result'] = results['node']['result'] root_node['state'] = results['node'].get('state', 'done') + if root_node.get('artifacts') is None: + root_node['artifacts'] = {} root_node['artifacts'].update(results['node']['artifacts']) root_node['data'].update(results['node'].get('data', {})) root_node['processed_by_kcidb_bridge'] = False