From f083b9c6664585d1b2b24bad7db504abb59d837b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 Sep 2019 09:54:43 +0100 Subject: [PATCH] Handle unparsable actor --- webinterface.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/webinterface.py b/webinterface.py index b817c0b3a..9dd309989 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1398,12 +1398,15 @@ def individualPostAsHtml(baseDir: str, \ if isAnnounced: if postJsonObject['object'].get('attributedTo'): announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo']) - announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo']) - announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache) - if announceDisplayName: - titleStr+=' '+announceDisplayName+'' + if announceNickname: + announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo']) + announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache) + if announceDisplayName: + titleStr+=' '+announceDisplayName+'' + else: + titleStr+=' @'+announceNickname+'@'+announceDomain+'' else: - titleStr+=' @'+announceNickname+'@'+announceDomain+'' + titleStr+=' @unattributed' else: titleStr+=' @unattributed' else: