fix other reloadchannels segfault with getepgid

Origin commit data
------------------
Branch: ni/coolstream
Commit: a0e658ddcf
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2021-10-20 (Wed, 20 Oct 2021)


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

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2021-10-20 19:31:13 +02:00
committed by vanhofen
parent 012fedd056
commit f66c1939e2
3 changed files with 13 additions and 5 deletions

View File

@@ -564,10 +564,12 @@ t_channel_id getepgid(std::string epg_name)
if (m == CZapitClient::MODE_RADIO)
cit = g_bouquetManager->radioChannelsBegin();
for (; !(cit.EndOfChannels()); cit++)
for (; g_bouquetManager->empty || !(cit.EndOfChannels()); cit++)
{
std::string tvg_id = (*cit)->getEPGmap();
if(g_bouquetManager->empty)
break;
std::string tvg_id = (*cit)->getEPGmap();
if (tvg_id.empty())
continue;
@@ -576,6 +578,8 @@ t_channel_id getepgid(std::string epg_name)
{
if (match_found)
{
if(g_bouquetManager->empty)
break;
if ((*cit)->getEpgID() == epgid) continue;
(*cit)->setEPGid(epgid);
}