Check that tags have a type

merge-requests/30/head
Bob Mottram 2021-10-27 16:10:18 +01:00
parent cfa09310a0
commit 1761c24bed
1 changed files with 6 additions and 0 deletions

View File

@ -596,6 +596,8 @@ def _getPosts(session, outboxUrl: str, maxPosts: int,
if isinstance(thisItem, dict):
if thisItem.get('tag'):
for tagItem in thisItem['tag']:
if not tagItem.get('type'):
continue
tagType = tagItem['type'].lower()
if tagType == 'emoji':
if tagItem.get('name') and tagItem.get('icon'):
@ -787,6 +789,8 @@ def getPostDomains(session, outboxUrl: str, maxPosts: int,
if item['object'].get('tag'):
for tagItem in item['object']['tag']:
if not tagItem.get('type'):
continue
tagType = tagItem['type'].lower()
if tagType == 'mention':
if tagItem.get('href'):
@ -855,6 +859,8 @@ def _getPostsForBlockedDomains(baseDir: str,
if item['object'].get('tag'):
for tagItem in item['object']['tag']:
if not tagItem.get('type'):
continue
tagType = tagItem['type'].lower()
if tagType == 'mention':
if tagItem.get('href'):