Skip to content

The conditional check in datatransfer does not validate whether the required transfer_id is set #228

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

Open
rasmunk opened this issue Apr 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rasmunk
Copy link
Contributor

rasmunk commented Apr 16, 2025

When the transfer_map is loaded in datatransfer.py via

transfer_dict = transfer_map.get(transfer_id, {})

The subsequent conditional check does not validate whether the transfer_id is actually present in the transfer_map since the following conditional check in both the action == 'deltransfer'

if transfer_dict is None:

and action == 'redotransfer'

if transfer_dict is None:

will never be true since an empty collection's truth value is false.

https://stackoverflow.com/questions/23177439/how-to-check-if-a-dictionary-is-empty
https://docs.python.org/3.8/library/stdtypes.html#truth-value-testing

Might be a leftover from python2

@jonasbardino jonasbardino linked a pull request Apr 23, 2025 that will close this issue
@jonasbardino jonasbardino added the bug Something isn't working label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants