[gnome-dvb-daemon] gnomedvb: Check if return value of get_schedule is not None



commit 740ba068f513b2ff6ab2defdd5c06ebd0b017638
Author: Sebastian Pölsterl <sebp k-d-w org>
Date:   Wed May 18 21:05:33 2011 +0200

    gnomedvb: Check if return value of get_schedule is not None

 client/gnomedvb/ui/widgets/RunningNextView.py |    7 ++++---
 client/gnomedvb/ui/widgets/ScheduleStore.py   |    5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/client/gnomedvb/ui/widgets/RunningNextView.py b/client/gnomedvb/ui/widgets/RunningNextView.py
index 6c624e7..bb32f4f 100644
--- a/client/gnomedvb/ui/widgets/RunningNextView.py
+++ b/client/gnomedvb/ui/widgets/RunningNextView.py
@@ -120,9 +120,10 @@ class RunningNextView(Gtk.TreeView):
                     devgroup = model.get_device_group()
                     sid = model[aiter][RunningNextStore.COL_SID]
                     schedule = devgroup.get_schedule(sid)
-                    schedule.get_informations(event_id,
-                        result_handler=show_details,
-                        error_handler=global_error_handler)
+                    if schedule != None:
+                        schedule.get_informations(event_id,
+                            result_handler=show_details,
+                            error_handler=global_error_handler)
 
     def _on_record_clicked(self, button, data):
         def on_reply(proxy, data, user_data):
diff --git a/client/gnomedvb/ui/widgets/ScheduleStore.py b/client/gnomedvb/ui/widgets/ScheduleStore.py
index b8f43f7..3d25736 100644
--- a/client/gnomedvb/ui/widgets/ScheduleStore.py
+++ b/client/gnomedvb/ui/widgets/ScheduleStore.py
@@ -42,8 +42,9 @@ class ScheduleStore(Gtk.ListStore):
     def __init__(self, dev_group, sid):
         Gtk.ListStore.__init__(self, gobject.TYPE_PYOBJECT, str, long, str, str, str, int, long)
         self._client = dev_group.get_schedule(sid)
-        self._recorder = dev_group.get_recorder()
-        self._fill_all()
+        if self._client != None:
+            self._recorder = dev_group.get_recorder()
+            self._fill_all()
         
     def reload_all(self):
         self.clear()



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