From bb8ac55513a851a55305fe448d3706facb4364b4 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 3 Jan 2016 10:51:39 +0530 Subject: [PATCH] filter invalid srt blocks --- source/Ox/js/String.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Ox/js/String.js b/source/Ox/js/String.js index 17f3a437..d958750c 100644 --- a/source/Ox/js/String.js +++ b/source/Ox/js/String.js @@ -212,7 +212,7 @@ Ox.parseSRT = function(string, fps) { var lines = block.split('\n'), points; if (lines.length < 3) { Ox.Log('Core', 'skip invalid srt block', lines); - continue; + return {}; } lines.shift(); points = lines.shift().split(' --> ').map(function(point) { @@ -232,7 +232,7 @@ Ox.parseSRT = function(string, fps) { out: points[1], text: lines.join('\n') }; - }); + }).filter(function(block) { return !Ox.isEmpty(block); }); }; /*@