From 7fc39379c979460f95a4300f67da5a57861dfff7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 7 Sep 2019 18:48:11 +0000 Subject: [PATCH] Check for existance of key in dictionary as well as non-null value to avoid uncaught KeyError re: issue #116 --- toot/tui/timeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py index 5b2f536..557d556 100644 --- a/toot/tui/timeline.py +++ b/toot/tui/timeline.py @@ -286,7 +286,7 @@ class StatusDetails(urwid.Pile): def card_generator(self, card): yield urwid.Text(("green", card["title"].strip())) - if card["author_name"]: + if card.get("author_name"): yield urwid.Text(["by ", ("yellow", card["author_name"].strip())]) yield urwid.Text("") if card["description"]: