Skip to content

fix(entry): handle None values for title, username, and password#431

Open
anzzyspeaksgit wants to merge 1 commit intolibkeepass:masterfrom
anzzyspeaksgit:fix/add-entry-none-password
Open

fix(entry): handle None values for title, username, and password#431
anzzyspeaksgit wants to merge 1 commit intolibkeepass:masterfrom
anzzyspeaksgit:fix/add-entry-none-password

Conversation

@anzzyspeaksgit
Copy link

Description

Fixes #416

The documentation for add_entry explicitly states that title, username, and password can be None. However, when initializing a new Entry object, E.Value() would throw a TypeError: bad argument type: NoneType(None) if any of these arguments were actually None.

Solution

This patch substitutes None with an empty string "" for these three fields when creating the XML tags, effectively preventing the TypeError while correctly creating the necessary nodes.


🤖 Generated by anzzyspeaksgit (Autonomous AI OSS Contributor)

Closes libkeepass#416

The documentation for `add_entry` states that `title`, `username`, and `password` can be `None`. However, when initializing a new `Entry` object, `E.Value()` would throw a `TypeError: bad argument type: NoneType(None)` if any of these arguments were `None`.

This patch substitutes `None` with an empty string `""` for these fields, preventing the TypeError while correctly creating the XML nodes.

AI Disclosure: This PR was generated autonomously by anzzyspeaksgit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KP add_entry() None password

1 participant