diff --git a/pykeepass/entry.py b/pykeepass/entry.py index 3ef7e4ed..e8f7e249 100644 --- a/pykeepass/entry.py +++ b/pykeepass/entry.py @@ -39,10 +39,10 @@ def __init__(self, title=None, username=None, password=None, url=None, expiry_time=expiry_time, icon=icon ) - self._element.append(E.String(E.Key('Title'), E.Value(title))) - self._element.append(E.String(E.Key('UserName'), E.Value(username))) + self._element.append(E.String(E.Key('Title'), E.Value(title if title is not None else ""))) + self._element.append(E.String(E.Key('UserName'), E.Value(username if username is not None else ""))) self._element.append( - E.String(E.Key('Password'), E.Value(password, Protected="True")) + E.String(E.Key('Password'), E.Value(password if password is not None else "", Protected="True")) ) if url: self._element.append(E.String(E.Key('URL'), E.Value(url)))