From 284da445f1186ab4cbd5991a4857b183404c00d3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 15 Dec 2023 17:30:26 +0000 Subject: [PATCH] Fix a few NoneType errors. --- client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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') -- 2.30.2