Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return None if deref encouters a broken reference (fixes #384) #386

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

br-olf
Copy link
Contributor

@br-olf br-olf commented Mar 21, 2024

Hi I tried to fix the issue #384 and wrote a small test but I didn't mess with the test databases so I used add_entry and delete_entry to set up my testcase.
If a reference is broken the code will now just return None and won't raise an exception. I think this is better and can be caught easily by the caller of deref.

@A6GibKm
Copy link
Contributor

A6GibKm commented Mar 22, 2024

Please give the PR and commit a more descriptive title.

Please also add to end of the commit description

Fixes: https://github.com/libkeepass/pykeepass/issues/384

@br-olf br-olf changed the title Fix for #384 Return None if deref encouters a broken reference (fixes #384) Mar 22, 2024
This commit introduces a check before a referenced entry is
resolved. If the referenced entry is not found `deref` will return
`None`. The commit also includes a test case for this behavior.

Fixes: libkeepass#384
@br-olf br-olf changed the title Return None if deref encouters a broken reference (fixes #384) Return None if deref encouters a broken reference (fixes #384) Mar 22, 2024
@br-olf
Copy link
Contributor Author

br-olf commented Mar 22, 2024

Done :)

@Evidlo
Copy link
Member

Evidlo commented Apr 9, 2024

Thanks for the fix.

@Evidlo Evidlo merged commit 83440f4 into libkeepass:master Apr 9, 2024
5 checks passed
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.

3 participants