From ebd1552cdd3e60d5eb21f97e46570de2e17ed19f Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Tue, 2 May 2006 16:58:16 +0000 Subject: [PATCH] don't crash if time is *really* invalid --- lib/python/Components/ServicePosition.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/python/Components/ServicePosition.py b/lib/python/Components/ServicePosition.py index cb444921..ba87e3ef 100644 --- a/lib/python/Components/ServicePosition.py +++ b/lib/python/Components/ServicePosition.py @@ -65,8 +65,11 @@ class ServicePosition(PerServiceDisplay): l = self.get(self.TYPE_POSITION) if l != -1: l += self.relative_base - t = time.localtime(l) - timestr = "%2d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec) + try: + t = time.localtime(l) + timestr = "%2d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec) + except ValueError: + timestr = "" else: timestr = "" -- 2.30.2