Fix xmltv writer crashing when a rating in the channel json is null for some reason (usually because of the python library)

This commit is contained in:
vexorian 2020-09-26 13:40:47 -04:00
parent c114cab269
commit c2a8bdc4c9

View File

@ -105,7 +105,7 @@ async function _writeProgramme(channel, program, xw) {
}
xw.endElement()
// Rating
if (typeof program.rating !== 'undefined') {
if ( (program.rating != null) && (typeof program.rating !== 'undefined') ) {
xw.startElement('rating')
xw.writeAttribute('system', 'MPAA')
xw.writeElement('value', program.rating)