From ec0e8f0f77a63956f09165ce562b98d0c5088245 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Sat, 19 May 2012 16:38:19 +0200 Subject: check if channel valid before sort --- eepg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eepg.c b/eepg.c index fb48110..7ad3743 100644 --- a/eepg.c +++ b/eepg.c @@ -1155,9 +1155,12 @@ void sortSchedules(cSchedules * Schedules, tChannelID channelID){ LogD(3, prep("Start sortEquivalent %s"), *channelID.ToString()); cChannel *pChannel = GetChannelByID (channelID, false); - cSchedule *pSchedule = (cSchedule *) Schedules->GetSchedule (pChannel, true); - pSchedule->Sort (); - Schedules->SetModified (pSchedule); + cSchedule *pSchedule; + if (pChannel) { + pSchedule = (cSchedule *) Schedules->GetSchedule (pChannel, true); + pSchedule->Sort (); + Schedules->SetModified (pSchedule); + } ret = equiChanMap.equal_range(*channelID.ToString()); for (it=ret.first; it!=ret.second; ++it) { -- cgit v1.2.3