Fix getitem usage for non-dictionaries

This commit is contained in:
Raphael Michel
2022-02-04 17:41:05 +01:00
parent 8351e51cfe
commit 216bac2807

View File

@@ -29,4 +29,9 @@ def getitem_filter(value, itemname):
if not value:
return ''
return value.get(itemname, '')
try:
return value[itemname]
except KeyError:
return ''
except TypeError:
return ''