apps: pager: Avoid crashes for notifications with no body
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
f924bb6414
commit
942e9f0bb4
1 changed files with 3 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue