From 95f46cf276fabdfd9990e58bb57fe94e7e4e7702 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 12 Dec 2019 12:57:08 +0000 Subject: [PATCH] Check that hashtag name exists --- utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.py b/utils.py index 6c059ca76..945b8fef8 100644 --- a/utils.py +++ b/utils.py @@ -354,6 +354,8 @@ def deletePost(baseDir: str,httpPrefix: str,nickname: str,domain: str,postFilena for tag in postJsonObject['object']['tag']: if tag['type']!='Hashtag': continue + if not tag.get('name'): + continue # find the index file for this tag tagIndexFilename=baseDir+'/tags/'+tag['name'][1:]+'.txt' if not os.path.isfile(tagIndexFilename):