From 1a66c396563e6afec774347cdcad55002f43be47 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 9 Mar 2021 23:22:48 +0000 Subject: [PATCH] Type check --- notifications_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 4480cc697..f6836c894 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -147,10 +147,12 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, title = speakerJson['notify']['title'] soundsDir = 'theme/default/sounds' if speakerJson['notify'].get('theme'): - soundsDir = \ - 'theme/' + speakerJson['notify']['theme'] + '/sounds' - if not os.path.isdir(soundsDir): - soundsDir = 'theme/default/sounds' + if isinstance(speakerJson['notify']['theme'], str): + soundsDir = \ + 'theme/' + \ + speakerJson['notify']['theme'] + '/sounds' + if not os.path.isdir(soundsDir): + soundsDir = 'theme/default/sounds' if speakerJson['notify']['dm'] != prevDM: if speakerJson['notify']['dm'] is True: _playNotificationSound(soundsDir + '/' +