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

Image can be None in construct_block function #142

Open
fabienheureux opened this issue Jan 21, 2022 · 1 comment
Open

Image can be None in construct_block function #142

fabienheureux opened this issue Jan 21, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@fabienheureux
Copy link
Contributor

fabienheureux commented Jan 21, 2022

In the construct_block function, the image variable can be None in some situations, hence failing when trying to access image.id.
I have a suggestion of adding a try / except, in order to fail silently in this case : fabienheureux@99bf46e

Any feedback welcome 👍

@nickmoreton nickmoreton added the bug Something isn't working label Jan 22, 2022
@nickmoreton
Copy link
Collaborator

Thanks Fabien

Could it be simpler this way?

"image": image_file.id if image_file else None,

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

No branches or pull requests

2 participants