infoviewer.cpp fix possible segfault if APIDs is empty

This commit is contained in:
Jacek Jendrzej
2015-04-02 15:00:08 +02:00
parent 32f38219c9
commit 9c4e8b028b

View File

@@ -1325,7 +1325,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data)
if ((*(t_channel_id *) data) == channel_id) { if ((*(t_channel_id *) data) == channel_id) {
if (is_visible && showButtonBar) if (is_visible && showButtonBar)
infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_AUDIO); infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_AUDIO);
if (g_settings.radiotext_enable && g_Radiotext && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio)) if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio))
g_Radiotext->setPid(g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid); g_Radiotext->setPid(g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid);
} }
return messages_return::handled; return messages_return::handled;