From 77643a4fe144cb908a372a2ceb99f36634457ca5 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Nov 2022 12:24:03 -0700 Subject: Add more error handling --- users/models/inbox_message.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'users/models/inbox_message.py') diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py index ee23ae6..fc81d71 100644 --- a/users/models/inbox_message.py +++ b/users/models/inbox_message.py @@ -65,6 +65,9 @@ class InboxMessageStates(StateGraph): f"Cannot handle activity of type undo.{unknown}" ) case "delete": + # If there is no object type, it's probably a profile + if not isinstance(instance.message["object"], dict): + raise ValueError("Cannot handle activity of type delete") match instance.message_object_type: case "tombstone": await sync_to_async(Post.handle_delete_ap)(instance.message) -- cgit v1.2.3