1
0
Fork 0

apps: pager: Avoid crashes for notifications with no body

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
pull/80/head
Daniel Thompson 2020-10-10 11:28:25 +01:00
parent f924bb6414
commit 942e9f0bb4
1 changed files with 3 additions and 1 deletions

View File

@ -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()