From 028c796402473cbae70a952eb0042de0d916ba76 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 5 Feb 2024 16:24:46 -0600 Subject: [PATCH] fix: allow dict without parameter key --- DDG4/python/DDSim/DD4hepSimulation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DDG4/python/DDSim/DD4hepSimulation.py b/DDG4/python/DDSim/DD4hepSimulation.py index 0917f7790..18a88fdf9 100644 --- a/DDG4/python/DDSim/DD4hepSimulation.py +++ b/DDG4/python/DDSim/DD4hepSimulation.py @@ -357,8 +357,9 @@ def run(self): (self.action.stack, DDG4.StackingAction, kernel.stackingAction)]: for action_dict in action_list: action = DDG4_Action(kernel, action_dict["name"]) - for parameter, value in action_dict['parameter'].items(): - setattr(action, parameter, value) + if 'parameter' in action_dict.keys(): + for parameter, value in action_dict['parameter'].items(): + setattr(action, parameter, value) kernel_Action().add(action) # ----------------------------------------------------------------------------------