mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
- controlapi/getchannel: fix possible crash when channel = NULL
This commit is contained in:
@@ -1298,6 +1298,8 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh)
|
|||||||
{
|
{
|
||||||
hh->outStart();
|
hh->outStart();
|
||||||
|
|
||||||
|
std::string result = "";
|
||||||
|
|
||||||
t_channel_id channel_id = 0;
|
t_channel_id channel_id = 0;
|
||||||
if (hh->ParamList["id"].empty())
|
if (hh->ParamList["id"].empty())
|
||||||
channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||||
@@ -1308,10 +1310,14 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh)
|
|||||||
{
|
{
|
||||||
NeutrinoAPI->GetChannelEvents();
|
NeutrinoAPI->GetChannelEvents();
|
||||||
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id);
|
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id);
|
||||||
std::string result = _GetBouquetWriteItem(hh, channel, -1, -1);
|
if (channel)
|
||||||
result = hh->outArray("channel", result);
|
{
|
||||||
|
result = _GetBouquetWriteItem(hh, channel, -1, -1);
|
||||||
hh->SendResult(result);
|
result = hh->outArray("channel", result);
|
||||||
|
hh->SendResult(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hh->SendError(hh->ParamList["id"] + " seems wrong");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hh->SendError();
|
hh->SendError();
|
||||||
|
Reference in New Issue
Block a user