From e20aea1b9c67a3505b86bb72a130b89158d69bdb Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Wed, 11 Jan 2023 10:26:01 -0700 Subject: [PATCH] Fixed #393: Deal with errors unpacking focalPoint --- activities/models/post.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/activities/models/post.py b/activities/models/post.py index 738e6ef..f3777b6 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -812,7 +812,10 @@ class Post(StatorModel): post.attachments.all().delete() for attachment in get_list(data, "attachment"): if "focalPoint" in attachment: - focal_x, focal_y = attachment["focalPoint"] + try: + focal_x, focal_y = attachment["focalPoint"] + except (ValueError, TypeError): + focal_x, focal_y = None, None else: focal_x, focal_y = None, None mimetype = attachment.get("mediaType")