gracefully handle missing parent key

This commit is contained in:
Jason Ertel
2024-06-08 07:44:46 -04:00
parent 5600fed9c4
commit f96b82b112
2 changed files with 12 additions and 1 deletions

View File

@@ -170,7 +170,7 @@ def replace(args):
def getKeyValue(content, key):
pieces = key.split(".", 1)
if len(pieces) > 1:
if len(pieces) > 1 and pieces[0] in content:
return getKeyValue(content[pieces[0]], pieces[1])
return content.get(key, None)