server/posts: fix handling corrupt files
In case of a ProcessingError, the image dimensions are set to None. But after that, they are compared with 0, which resulted in a TypeError.
This commit is contained in:
parent
9b27e113b3
commit
0cfc9bcafd
|
@ -334,7 +334,8 @@ def update_post_content(post, content):
|
|||
except errors.ProcessingError:
|
||||
post.canvas_width = None
|
||||
post.canvas_height = None
|
||||
if post.canvas_width <= 0 or post.canvas_height <= 0:
|
||||
if (post.canvas_width is not None and post.canvas_width <= 0) \
|
||||
or (post.canvas_height is not None and post.canvas_height <= 0):
|
||||
post.canvas_width = None
|
||||
post.canvas_height = None
|
||||
setattr(post, '__content', content)
|
||||
|
|
Loading…
Reference in New Issue