fix bug by checking if data value is a dict

This commit is contained in:
2019-02-13 09:11:28 +01:00
parent dfaba9a1e0
commit 71e57b2e5b

View File

@@ -157,7 +157,7 @@ def get_value(data, element):
keys = element.split('/')
for key in keys:
data = data.get(key)
if data and len(data) == 1:
if isinstance(data, dict) and data and len(data) == 1:
data = next(iter(data.values()))
return data