diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 0c7260f931..8ecf5278e2 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -3982,7 +3982,9 @@ shaka.hls.HlsParser = class { } let dateRangeTags = shaka.hls.Utils.filterTagsByName(tags, 'EXT-X-DATERANGE'); - dateRangeTags = dateRangeTags.sort((a, b) => { + dateRangeTags = dateRangeTags.filter((tag) => { + return tag.getAttribute('START-DATE') != null; + }).sort((a, b) => { const aStartDateValue = a.getRequiredAttrValue('START-DATE'); const bStartDateValue = b.getRequiredAttrValue('START-DATE'); if (aStartDateValue < bStartDateValue) {