diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-03-18 10:16:56 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-03-18 10:16:56 +0100 |
commit | 191fb910bf8f908266dd512a9c649cc906cb72d0 (patch) | |
tree | b27f0a6657a61c707d69894406d7c769cb5f3943 /menu.c | |
parent | 1966a1587653a4d352c7ccd7cdeaa9d3a4ad39ac (diff) | |
download | vdr-191fb910bf8f908266dd512a9c649cc906cb72d0.tar.gz vdr-191fb910bf8f908266dd512a9c649cc906cb72d0.tar.bz2 |
Fixed a segfault in the Schedule menu in case there is no EPG information
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 40 |
1 files changed, 22 insertions, 18 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.69 2001/03/04 11:37:22 kls Exp $ + * $Id: menu.c 1.70 2001/03/18 10:16:56 kls Exp $ */ #include "menu.h" @@ -1425,23 +1425,27 @@ eOSState cMenuSchedule::ProcessKey(eKeys Key) if (state == osUnknown) { switch (Key) { case kRed: return Record(); - case kGreen: { - if (!now && !next) { - int ChannelNr = 0; - if (Count()) { - cChannel *channel = Channels.GetByServiceID(((cMenuScheduleItem *)Get(Current()))->eventInfo->GetServiceID()); - if (channel) - ChannelNr = channel->number; - } - now = true; - return AddSubMenu(new cMenuWhatsOn(schedules, true, ChannelNr)); - } - now = !now; - next = !next; - return AddSubMenu(new cMenuWhatsOn(schedules, now, cMenuWhatsOn::CurrentChannel())); - } - case kYellow: return AddSubMenu(new cMenuWhatsOn(schedules, false, cMenuWhatsOn::CurrentChannel())); - case kBlue: return Switch(); + case kGreen: if (schedules) { + if (!now && !next) { + int ChannelNr = 0; + if (Count()) { + cChannel *channel = Channels.GetByServiceID(((cMenuScheduleItem *)Get(Current()))->eventInfo->GetServiceID()); + if (channel) + ChannelNr = channel->number; + } + now = true; + return AddSubMenu(new cMenuWhatsOn(schedules, true, ChannelNr)); + } + now = !now; + next = !next; + return AddSubMenu(new cMenuWhatsOn(schedules, now, cMenuWhatsOn::CurrentChannel())); + } + case kYellow: if (schedules) + return AddSubMenu(new cMenuWhatsOn(schedules, false, cMenuWhatsOn::CurrentChannel())); + break; + case kBlue: if (Count()) + return Switch(); + break; case kOk: if (Count()) return AddSubMenu(new cMenuEvent(((cMenuScheduleItem *)Get(Current()))->eventInfo, otherChannel)); break; |