Use empty string for custom fields name/value when empty (returned as null from api)

Fixes #2
This commit is contained in:
David Němec 2021-01-08 18:34:08 +01:00
parent 9fc8bcf9a8
commit ef90e20d42
No known key found for this signature in database
GPG Key ID: B1064EFFFD11AA75
2 changed files with 5 additions and 1 deletions

View File

@ -69,7 +69,7 @@ def bitwarden_to_keepass(args):
break # todo append additional uris to notes?
for field in bw_item.get_custom_fields():
entry.set_custom_property(str(field['name']), field['value'])
entry.set_custom_property(field['name'], field['value'])
for attachment in bw_item.get_attachments():
attachment_tmp_path = f'/tmp/attachment/{attachment["fileName"]}'

View File

@ -47,6 +47,10 @@ class Item:
if 'fields' not in self.item:
return []
for field in self.item['fields']:
field['name'] = field['name'] if field['name'] is not None else ''
field['value'] = field['value'] if field['value'] is not None else ''
return self.item['fields']
def get_attachments(self):