neutrino: fix nullpointer crash if no channels are present

Origin commit data
------------------
Branch: ni/coolstream
Commit: b8aa68a2da
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-05-29 (Wed, 29 May 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2013-05-29 15:34:35 +02:00
committed by Jacek Jendrzej
parent 5f1b5fbdcb
commit e7b5ed98f6
2 changed files with 6 additions and 3 deletions

View File

@@ -147,6 +147,8 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec
void CBEChannelSelectWidget::onOkKeyPressed() void CBEChannelSelectWidget::onOkKeyPressed()
{ {
if (selected >= Channels.size())
return;
setModified(); setModified();
if (isChannelInBouquet(selected)) if (isChannelInBouquet(selected))
g_bouquetManager->Bouquets[bouquet]->removeService(Channels[selected]->channel_id); g_bouquetManager->Bouquets[bouquet]->removeService(Channels[selected]->channel_id);

View File

@@ -931,7 +931,8 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
} }
} }
else if (msg == CRCInput::RC_ok) { else if (msg == CRCInput::RC_ok) {
CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(this->selectedChannelEntry->channel->channel_id); if (selectedChannelEntry)
CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(selectedChannelEntry->channel->channel_id);
current_bouquet = bouquetList->getActiveBouquetNumber(); current_bouquet = bouquetList->getActiveBouquetNumber();
} }
else if (CRCInput::isNumeric (msg)) { else if (CRCInput::isNumeric (msg)) {
@@ -1006,8 +1007,8 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_RECORD, true, NULL, &record, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), false); menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_RECORD, true, NULL, &record, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), false);
menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_REFRESH_EPG, true, NULL, &refresh, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), false); menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_REFRESH_EPG, true, NULL, &refresh, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), false);
menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_REMIND, true, NULL, &remind, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), false); menuWidgetActions.addItem (new CMenuForwarder (LOCALE_EPGPLUS_REMIND, true, NULL, &remind, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), false);
if (selectedChannelEntry)
menuWidgetActions.exec (NULL, ""); menuWidgetActions.exec (NULL, "");
this->refreshAll = true; this->refreshAll = true;
} }