summaryrefslogtreecommitdiff
path: root/epgclone.c
diff options
context:
space:
mode:
Diffstat (limited to 'epgclone.c')
-rw-r--r--epgclone.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/epgclone.c b/epgclone.c
index 4c7b28e..46397d1 100644
--- a/epgclone.c
+++ b/epgclone.c
@@ -48,11 +48,22 @@ void cEpgClone::CloneEvent(cEvent *Source, cEvent *Dest) {
if (Source->Seen())
Dest->SetSeen();
tChannelID channelID;
- if (dest_num)
- channelID = Channels.GetByNumber(dest_num)->GetChannelID();
+ if (dest_num) {
+ cChannel *dest_chan = Channels.GetByNumber(dest_num);
+ if (dest_chan)
+ channelID = Channels.GetByNumber(dest_num)->GetChannelID();
+ else
+ channelID = tChannelID::InvalidID;
+ }
else
channelID = tChannelID::FromString(dest_str);
- AddEvent(Dest, channelID);
+ if (channelID == tChannelID::InvalidID) {
+ enabled = false;
+ delete Dest;
+ error("Destination channel %s not found for cloning, disabling cloning!", (dest_num ? *itoa(dest_num) : dest_str));
+ }
+ else
+ AddEvent(Dest, channelID);
}
bool cEpgClone::Apply(cEvent *Event)