From 61ff46ad1c804f13428234e4b7115764767c8b88 Mon Sep 17 00:00:00 2001 From: sireebob Date: Wed, 2 Sep 2020 22:42:29 +0000 Subject: [PATCH] prevent an error for posts missing an inReplyTo key. --- inbox.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/inbox.py b/inbox.py index f5ae165a..58a19ee2 100644 --- a/inbox.py +++ b/inbox.py @@ -2364,17 +2364,18 @@ def inboxAfterCapabilities(recentPostsCache: {}, maxRecentPosts: int, if nickname != 'inbox': # replies index will be updated updateIndexList.append('tlreplies') - inReplyTo = postJsonObject['object']['inReplyTo'] - if inReplyTo: - if isinstance(inReplyTo, str): - if not isMuted(baseDir, nickname, domain, - inReplyTo): - replyNotify(baseDir, handle, - httpPrefix + '://' + domain + - '/users/' + nickname + - '/tlreplies') - else: - isReplyToMutedPost = True + if postJsonObject['object'].get('inReplyTo'): + inReplyTo = postJsonObject['object']['inReplyTo'] + if inReplyTo: + if isinstance(inReplyTo, str): + if not isMuted(baseDir, nickname, domain, + inReplyTo): + replyNotify(baseDir, handle, + httpPrefix + '://' + domain + + '/users/' + nickname + + '/tlreplies') + else: + isReplyToMutedPost = True if isImageMedia(session, baseDir, httpPrefix, nickname, domain, postJsonObject,