From ac38dbbb36b96e212f2116d1c19d587c84a37f9e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 5 Feb 2020 18:50:53 +0000 Subject: [PATCH] Check object type --- webinterface.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/webinterface.py b/webinterface.py index 920940f8..cbb34e3e 100644 --- a/webinterface.py +++ b/webinterface.py @@ -3131,20 +3131,21 @@ def htmlIndividualPost(recentPostsCache: {},maxRecentPosts: int, \ messageId=postJsonObject['id'].replace('/activity','') # show the previous posts - while postJsonObject['object'].get('inReplyTo'): - postFilename=locatePost(baseDir,nickname,domain,postJsonObject['object']['inReplyTo']) - if not postFilename: - break - postJsonObject=loadJson(postFilename) - if postJsonObject: - postStr= \ - individualPostAsHtml(recentPostsCache,maxRecentPosts, \ - iconsDir,translate,None, \ - baseDir,session,wfRequest,personCache, \ - nickname,domain,port,postJsonObject, \ - None,True,False, \ - httpPrefix,projectVersion,'inbox', \ - False,authorized,False,False,False)+postStr + if isinstance(postJsonObject['object'], dict): + while postJsonObject['object'].get('inReplyTo'): + postFilename=locatePost(baseDir,nickname,domain,postJsonObject['object']['inReplyTo']) + if not postFilename: + break + postJsonObject=loadJson(postFilename) + if postJsonObject: + postStr= \ + individualPostAsHtml(recentPostsCache,maxRecentPosts, \ + iconsDir,translate,None, \ + baseDir,session,wfRequest,personCache, \ + nickname,domain,port,postJsonObject, \ + None,True,False, \ + httpPrefix,projectVersion,'inbox', \ + False,authorized,False,False,False)+postStr # show the following posts postFilename=locatePost(baseDir,nickname,domain,messageId)