wagtail-wordpress-import
wagtail-wordpress-import copied to clipboard
Image can be None in construct_block function
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 : https://github.com/fabienheureux/wagtail-wordpress-import/commit/99bf46e02666283d06a6504db9acbf5e5f21fa4e
Any feedback welcome :+1:
Thanks Fabien
Could it be simpler this way?
"image": image_file.id if image_file else None,