diff --git a/outbox.py b/outbox.py index 6dc12b193..731ba1aed 100644 --- a/outbox.py +++ b/outbox.py @@ -62,7 +62,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {}, if not messageJson.get('type'): return - print("messageJson['type'] " + messageJson['type']) + if not isinstance(messageJson['type'], str): + if debug: + print('DEBUG: c2s actor update type is not a string') + return if messageJson['type'] != 'Update': return if not hasObjectDict(messageJson): @@ -73,6 +76,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {}, if debug: print('DEBUG: c2s actor update - no type') return + if not isinstance(messageJson['object']['type'], str): + if debug: + print('DEBUG: c2s actor update object type is not a string') + return if messageJson['object']['type'] != 'Person': if debug: print('DEBUG: not a c2s actor update') @@ -89,6 +96,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {}, if debug: print('DEBUG: c2s actor update has no id field') return + if not isinstance(messageJson['id'], str): + if debug: + print('DEBUG: c2s actor update id is not a string') + return actor = \ httpPrefix + '://' + getFullDomain(domain, port) + '/users/' + nickname if len(messageJson['to']) != 1: