summaryrefslogtreecommitdiff
path: root/epggrid.c
diff options
context:
space:
mode:
Diffstat (limited to 'epggrid.c')
-rw-r--r--epggrid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epggrid.c b/epggrid.c
index 79cdae7..f4dbcd7 100644
--- a/epggrid.c
+++ b/epggrid.c
@@ -102,7 +102,10 @@ void cEpgGrid::CreateChannels(const cChannel *startChannel, int activeChannel) {
if (!foundEnough) {
int numCurrent = channels.Count();
int numBack = channelsPerPage - numCurrent;
- int newChannelNumber = channels.First()->GetChannelNumber() - numBack;
+ cChannelEpg *first = channels.First();
+ int newChannelNumber = 1;
+ if (first)
+ newChannelNumber = first->GetChannelNumber() - numBack;
const cChannel *newStart = Channels.GetByNumber(newChannelNumber);
CreateChannels(newStart, pos+1);
}