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

Wrong check of payload.value in invoke_method function #9

Open
oleg-budylin opened this issue Jul 25, 2024 · 2 comments
Open

Wrong check of payload.value in invoke_method function #9

oleg-budylin opened this issue Jul 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@oleg-budylin
Copy link

Get the data from UPayload

if not payload.value:
    msg = "The data in UPayload should be Data::Value"
    logging.debug(f"{msg}")
    raise UStatus(code=UCode.INVALID_ARGUMENT, message=msg)

payload.value may be empty, so it is better to check with

if payload.value is None:
@neelam-kushwah
Copy link
Contributor

If payload.value is None, the condition not payload.value will also return True.

@oleg-budylin
Copy link
Author

oleg-budylin commented Jul 26, 2024

If payload.value is None, the condition not payload.value will also return True.

exactly, but (not payload.value) is True for payload.value = {} or [] or ""

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
Status: Todo
Development

No branches or pull requests

2 participants