[gnome-dvb-daemon] gnomedvb: Always check if return value of get_device_group is not None



commit 1cf8a20a9b671767476b464ac1627cde2c47bbf1
Author: Sebastian Pölsterl <sebp k-d-w org>
Date:   Wed May 18 21:01:07 2011 +0200

    gnomedvb: Always check if return value of get_device_group is not None

 .../ui/controlcenter/ControlCenterWindow.py        |    2 +-
 client/gnomedvb/ui/preferences/Preferences.py      |    2 +-
 client/totem-plugin/dvb-daemon.py                  |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py b/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
index 3917434..9389336 100644
--- a/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
+++ b/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
@@ -375,7 +375,7 @@ class ControlCenterWindow(Gtk.Window):
 
     def _on_manager_group_added(self, manager, group_id):
         group = self.manager.get_device_group(group_id)
-        if group:
+        if group != None:
             self._append_group(group)
             self.check_single_group_mode()
         
diff --git a/client/gnomedvb/ui/preferences/Preferences.py b/client/gnomedvb/ui/preferences/Preferences.py
index 77e4973..d3cefc9 100644
--- a/client/gnomedvb/ui/preferences/Preferences.py
+++ b/client/gnomedvb/ui/preferences/Preferences.py
@@ -324,7 +324,7 @@ class Preferences(Gtk.Window):
 
     def _on_manager_group_added(self, manager, group_id):
         group = manager.get_device_group(group_id)
-        if group:
+        if group != None:
             self._append_group(group, remove_unassigned=True)
     
     def _on_manager_group_removed(self, manager, group_id):        
diff --git a/client/totem-plugin/dvb-daemon.py b/client/totem-plugin/dvb-daemon.py
index c39f154..337ed26 100644
--- a/client/totem-plugin/dvb-daemon.py
+++ b/client/totem-plugin/dvb-daemon.py
@@ -556,6 +556,8 @@ class DVBDaemonPlugin(gobject.GObject, Peas.Activatable):
                     url, success = self.recstore.get_location(sid)
                 else:
                     group = gnomedvb.DVBManagerClient().get_device_group(group_id)
+                    if group == None:
+                        return
                     channellist = group.get_channel_list()
                     url, success = channellist.get_channel_url(sid)
                 self.totem_object.action_remote(Totem.RemoteCommand.REPLACE, url)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]