Skip to content
Snippets Groups Projects
Commit 129163c2 authored by Michelle Weidling's avatar Michelle Weidling :blowfish:
Browse files

fix: missing condition

parent 8165143b
No related branches found
No related tags found
No related merge requests found
Pipeline #508921 passed
......@@ -21,8 +21,9 @@ def remove_key_from_dict(d: dict, tbr_key: str) -> None:
"""
This function removes keys with the value of null from the result.
"""
for key in list(d.keys()):
if key == tbr_key and d[key] == None:
del d[key]
else:
remove_key_from_dict(d[key], tbr_key)
if isinstance(d, dict):
for key in list(d.keys()):
if key == tbr_key and d[key] == None:
del d[key]
else:
remove_key_from_dict(d[key], tbr_key)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment