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

Check for existence of keys in delete routines #2

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

tmns
Copy link
Contributor

@tmns tmns commented Dec 10, 2019

Hi all 👋

When calling delete_all_events and delete_temporary_bitop_keys with an empty keys object the following exception is thrown:

TypeError: object of type 'NoneType' has no len()

This was also pointed out in the repo of the previous version here: Doist/bitmapist#31

To prevent the error from being thrown I changed the if len(keys) > 0 check to just if keys, as this both checks if it exists and if its length is greater than 0 (an empty list is falsy).

What do you think about this as a solution?

@imankulov
Copy link
Contributor

Hi @tmns. Thanks for the report. As it turns out, it's actually a bitmapist-server issue (reported in Doist/bitmapist-server#10). While the server-side fix is not ready yet, I think your patch makes much sense. Will merge it in 👍

@imankulov imankulov merged commit ee36c7a into Doist:master Dec 19, 2019
@tmns tmns deleted the with-check-for-keys branch December 19, 2019 17:30
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.

None yet

2 participants