From 5b4c799c985564da85561cafc9b8161164e2ff1b Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Thu, 26 Oct 2023 07:41:51 +0200 Subject: [PATCH] fix: Settings name translation has to check the existence of key In the 'xml_setconfig' function, the names of the passed dictionary are translated into new names. However, there is no obligation to hand over all fields in the setting dict. This bugfix checks whether the keys exist before translating. Refs: 6d56c667 Signed-off-by: Sven Sager --- src/revpipyload/revpipyload.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/revpipyload/revpipyload.py b/src/revpipyload/revpipyload.py index cc8c00b..cfe77d1 100644 --- a/src/revpipyload/revpipyload.py +++ b/src/revpipyload/revpipyload.py @@ -1294,8 +1294,9 @@ class RevPiPyLoad: ("plcslaveport", "plcserverport"), ("plcslavewatchdog", "plcserverwatchdog"), ): - dc[key_to] = dc[key_from] - del dc[key_from] + if key_from in dc: + dc[key_to] = dc[key_from] + del dc[key_from] # Werte übernehmen, die eine Definition in key haben (andere nicht) for sektion in keys: