From 2186fdb87017574e5a8f4bc738a1fa900901571c Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sat, 4 Jun 2011 23:24:39 +0100 Subject: [PATCH] Catch snd_path is None error in Notification Plugin --- .../plugins/notifications/notifications/gtkui.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/deluge/plugins/notifications/notifications/gtkui.py b/deluge/plugins/notifications/notifications/gtkui.py index ae8909f45..55a5fb242 100644 --- a/deluge/plugins/notifications/notifications/gtkui.py +++ b/deluge/plugins/notifications/notifications/gtkui.py @@ -441,13 +441,15 @@ class GtkUI(GtkPluginBase, GtkUiNotifications): snd_path = self.config['custom_sounds'][event_name] else: snd_path = self.config['sound_path'] - self.sounds_model.set( - self.sounds_model.append(), - SND_EVENT, event_name, - SND_EVENT_DOC, event_doc, - SND_NAME, basename(snd_path), - SND_PATH, snd_path - ) + + if snd_path: + self.sounds_model.set( + self.sounds_model.append(), + SND_EVENT, event_name, + SND_EVENT_DOC, event_doc, + SND_NAME, basename(snd_path), + SND_PATH, snd_path + ) def populate_subscriptions(self, handled_events, email_subscriptions=[]): subscriptions_dict = self.config['subscriptions']