summaryrefslogtreecommitdiff
path: root/wasp
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-10-10 10:28:25 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-10-10 10:28:25 (GMT)
commit942e9f0bb42583a97360a9421d755b0241a7f010 (patch)
tree65e002fc3cada766c8fa91666fe643e0ebb3bfa5 /wasp
parentf924bb64142fc0771c705971dd43452ec3778342 (diff)
apps: pager: Avoid crashes for notifications with no body
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp')
-rw-r--r--wasp/apps/pager.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/wasp/apps/pager.py b/wasp/apps/pager.py
index edb5418..db12b3f 100644
--- a/wasp/apps/pager.py
+++ b/wasp/apps/pager.py
@@ -89,7 +89,9 @@ class NotificationApp(PagerApp):
id = next(iter(notes))
note = notes[id]
del notes[id]
- self._msg = '{}\n\n{}'.format(note['title'], note['body'])
+ title = note['title'] if 'title' in note else 'Untitled'
+ body = note['body'] if 'body' in note else ''
+ self._msg = '{}\n\n{}'.format(title, body)
super().foreground()