record.cpp: avoid segfault in CRecordManager::getUseCI()

Origin commit data
------------------
Commit: 79c12ed7ad
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-11-16 (Wed, 16 Nov 2016)

Origin message was:
------------------
- record.cpp: avoid segfault in CRecordManager::getUseCI()
This commit is contained in:
vanhofen
2016-11-16 00:49:45 +01:00
parent c94723bf8e
commit 13da8f1513

View File

@@ -1820,10 +1820,14 @@ CRecordInstance* CRecordManager::getUseCI()
mutex.lock();
for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) {
CRecordInstance * inst = it->second;
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(inst->GetChannelId());
if (channel->bUseCI) {
mutex.unlock();
return inst;
if (inst)
{
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(inst->GetChannelId());
if (channel && channel->bUseCI)
{
mutex.unlock();
return inst;
}
}
}
mutex.unlock();