fix crash when try to open similar event list when no similar events are found
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 20 Apr 2006 13:57:24 +0000 (13:57 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 20 Apr 2006 13:57:24 +0000 (13:57 +0000)
lib/python/Components/EpgList.py

index 1ea0a1c..7169a26 100644 (file)
@@ -289,7 +289,8 @@ class EPGList(HTMLComponent, GUIComponent):
                if event_id is None:
                        return
                l = self.epgcache.search(('RIBN', 1024, eEPGCache.SIMILAR_BROADCASTINGS_SEARCH, refstr, event_id))
                if event_id is None:
                        return
                l = self.epgcache.search(('RIBN', 1024, eEPGCache.SIMILAR_BROADCASTINGS_SEARCH, refstr, event_id))
-               l.sort(self.sort_func)
+               if l and len(l):
+                       l.sort(self.sort_func)
                self.l.setList(l)
                self.selectionChanged()
                print time() - t
                self.l.setList(l)
                self.selectionChanged()
                print time() - t