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

periodic_task_name tries to call get on a possibly NoneType object #280

Closed
KOliver94 opened this issue Jan 9, 2022 · 0 comments · Fixed by #281
Closed

periodic_task_name tries to call get on a possibly NoneType object #280

KOliver94 opened this issue Jan 9, 2022 · 0 comments · Fixed by #281

Comments

@KOliver94
Copy link
Contributor

KOliver94 commented Jan 9, 2022

PR #261 introduced a new bug with the following lines:

properties = getattr(request, 'properties', {})
periodic_task_name = properties.get('periodic_task_name', None)

The problem is that request object can contain properties with None value. As a result properites will be None instead of an empty dictionary which will cause an exception when the next line tries to call .get on it.

Update: It might be easily fixable with the following change:

properties = getattr(request, 'properties') or {}
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 a pull request may close this issue.

1 participant