From: Simon Tatham Date: Fri, 15 Dec 2023 17:30:26 +0000 (+0000) Subject: Fix a few NoneType errors. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=284da445f1186ab4cbd5991a4857b183404c00d3;p=mastodonochrome.git Fix a few NoneType errors. --- diff --git a/client.py b/client.py index 8fbc42f..365a34a 100644 --- a/client.py +++ b/client.py @@ -232,7 +232,7 @@ class IncrementalServerFeed(Feed): return False self.data[0:0] = list(self.get(d) for d in reversed(data)) self.origin += len(data) - self.next_link = links['next'] + self.next_link = links.get('next') return len(data) > 0 def extend_future(self): @@ -244,7 +244,7 @@ class IncrementalServerFeed(Feed): if len(data) == 0: return False self.data.extend(self.get(d) for d in reversed(data)) - self.prev_link = links['prev'] + self.prev_link = links.get('prev') return len(data) > 0 class HomeTimelineFeed(IncrementalServerFeed): @@ -446,7 +446,9 @@ class Status: self.client.fq(mention['acct']), 'f')) yield text.BlankLine() - app_subdict = self.data.get('application', {}) + app_subdict = self.data.get('application') + if app_subdict is None: + app_subdict = {} client = noneify(app_subdict.get('name')) yield text.Paragraph("Client name: " + client) client_url = noneify(app_subdict.get('website'), colour='u')