[outtmpl] Do not traverse None

Closes #1585
This commit is contained in:
pukkandan
2021-11-08 00:23:57 +05:30
parent aeec0e44e2
commit 582fad70f5
2 changed files with 3 additions and 2 deletions

View File

@@ -6442,10 +6442,10 @@ def traverse_obj(
def _traverse_obj(obj, path, _current_depth=0):
nonlocal depth
if obj is None:
return None
path = tuple(variadic(path))
for i, key in enumerate(path):
if obj is None:
return None
if isinstance(key, (list, tuple)):
obj = [_traverse_obj(obj, sub_key, _current_depth) for sub_key in key]
key = ...