From c2a8bdc4c97c31dcc5cbae63d877aeab630584df Mon Sep 17 00:00:00 2001 From: vexorian Date: Sat, 26 Sep 2020 13:40:47 -0400 Subject: [PATCH] Fix xmltv writer crashing when a rating in the channel json is null for some reason (usually because of the python library) --- src/xmltv.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmltv.js b/src/xmltv.js index 054bf81..d1596be 100644 --- a/src/xmltv.js +++ b/src/xmltv.js @@ -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)