From 67ac08bd138e956111e98a80a3c3adabf5e71d48 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Sat, 8 Apr 2006 13:44:54 +0000 Subject: [PATCH] fix crash when press red button in empty timerlist fix crash when press ok directly after e2 start --- lib/python/Screens/ChannelSelection.py | 25 +++++++++++++------------ lib/python/Screens/TimerEdit.py | 8 +++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index d8aa39d4..065d36ca 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -873,18 +873,19 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect self.session.nav.playService(nref) self.saveRoot() self.saveChannel() - tmp=self.servicePath[:] - tmp.append(nref) - try: - del self.history[self.history_pos+1:] - except: - pass - self.history.append(tmp) - hlen = len(self.history) - if hlen > HISTORYSIZE: - del self.history[0] - hlen -= 1 - self.history_pos = hlen-1 + if self.servicePath is not None: + tmp=self.servicePath[:] + tmp.append(nref) + try: + del self.history[self.history_pos+1:] + except: + pass + self.history.append(tmp) + hlen = len(self.history) + if hlen > HISTORYSIZE: + del self.history[0] + hlen -= 1 + self.history_pos = hlen-1 def historyBack(self): hlen = len(self.history) diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 018e28dc..2c7afef5 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -103,9 +103,11 @@ class TimerEditList(Screen): def removeTimer(self): list = self["timerlist"] - timer = list.getCurrent()[0] - self.session.nav.RecordTimer.removeEntry(timer) - self.refill() + cur = list.getCurrent() + if cur is not None: + timer = cur[0] + self.session.nav.RecordTimer.removeEntry(timer) + self.refill() def refill(self): self.fillTimerList() -- 2.30.2