From 058b88577c8b00c9066a178fe16a3fb295716b1b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Mar 2021 17:52:41 +0000 Subject: [PATCH] Handle no notifications --- notifications_client.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 86cb25895..0aceb0743 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -409,19 +409,20 @@ def _showLocalBox(notifyJson: {}, boxName: str, _clearScreen() _showDesktopBanner() notificationIcons = '' - if notifyJson.get('followRequests'): - notificationIcons += '👤' - if notifyJson.get('dm'): - notificationIcons += '📩' - if notifyJson.get('reply'): - notificationIcons += '📨' - if notifyJson.get('calendar'): - notificationIcons += '📅' - if notifyJson.get('share'): - notificationIcons += '🤝' - if notifyJson.get('likedBy'): - if '##sent##' not in notifyJson['likedBy']: - notificationIcons += '❤' + if notifyJson: + if notifyJson.get('followRequests'): + notificationIcons += '👤' + if notifyJson.get('dm'): + notificationIcons += '📩' + if notifyJson.get('reply'): + notificationIcons += '📨' + if notifyJson.get('calendar'): + notificationIcons += '📅' + if notifyJson.get('share'): + notificationIcons += '🤝' + if notifyJson.get('likedBy'): + if '##sent##' not in notifyJson['likedBy']: + notificationIcons += '❤' titleStr = boxName.upper() if notificationIcons: while len(titleStr) < 40 - len(notificationIcons):