diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 307dec4bf..097eb7f1e 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -837,8 +837,10 @@ void writeEventsToFile(const char *epgdir) } (*e)->saveXML(eventfile); } - write_epgxml_footer(eventfile); - fclose(eventfile); + if (eventfile != NULL) { + write_epgxml_footer(eventfile); + fclose(eventfile); + } _done: unlockEvents(); write_indexxml_footer(indexfile);