summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmirl <schmirl>2007-03-02 15:27:07 +0000
committerschmirl <schmirl>2007-03-02 15:27:07 +0000
commit1e9e200e8a9e781d5cdc8da8a5ac7d2cad49144c (patch)
treea435534050e594229594ff606539298b83e065cc
parent59a4969b3f9be950e8bd0cb867b2b88aff4e694c (diff)
downloadvdr-plugin-streamdev-1e9e200e8a9e781d5cdc8da8a5ac7d2cad49144c.tar.gz
vdr-plugin-streamdev-1e9e200e8a9e781d5cdc8da8a5ac7d2cad49144c.tar.bz2
Fixed null pointers
-rw-r--r--server/connectionVTP.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/server/connectionVTP.c b/server/connectionVTP.c
index b66d224..18ea353 100644
--- a/server/connectionVTP.c
+++ b/server/connectionVTP.c
@@ -1,5 +1,5 @@
/*
- * $Id: connectionVTP.c,v 1.7 2005/05/09 20:22:29 lordjaxom Exp $
+ * $Id: connectionVTP.c,v 1.8 2007/03/02 15:27:07 schmirl Exp $
*/
#include "server/connectionVTP.h"
@@ -168,10 +168,17 @@ bool cLSTEHandler::Next(bool &Last)
if (m_Schedule != NULL) {
cChannel *channel = Channels.GetByChannelID(m_Schedule->ChannelID(),
true);
- m_State = Event;
- return m_Client->Respond(-215, "C %s %s",
+ if (channel != NULL) {
+ m_State = Event;
+ return m_Client->Respond(-215, "C %s %s",
*channel->GetChannelID().ToString(),
channel->Name());
+ } else {
+ esyslog("ERROR: vdr streamdev: unable to find channel %s by ID",
+ *m_Schedule->ChannelID().ToString());
+ m_State = EndChannel;
+ return Next(Last);
+ }
} else {
m_State = EndEPG;
return Next(Last);
@@ -796,7 +803,11 @@ bool cConnectionVTP::CmdLSTX(cHandler *&Handler, char *Option)
Handler = new cHandler(this, Option);
}
- bool last, result = Handler->Next(last);
+ bool last, result = false;
+ if (Handler != NULL)
+ result = Handler->Next(last);
+ else
+ esyslog("ERROR: vdr streamdev: Handler in LSTX command is NULL");
if (!result || last)
DELETENULL(Handler);