From a21a11d499031ebe4011f2426f91acd3d3ec58a7 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 17 Feb 2019 16:29:39 +0100 Subject: [PATCH] Only proceed with subtitles loading when the list of subs is not empty --- platypush/backend/http/static/js/media.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/static/js/media.js b/platypush/backend/http/static/js/media.js index 481ea9a3c..6ee5694c6 100644 --- a/platypush/backend/http/static/js/media.js +++ b/platypush/backend/http/static/js/media.js @@ -339,7 +339,7 @@ $(document).ready(function() { if (subtitlesConf) { populateSubtitlesModal(resource).then((subs) => { if ('language' in subtitlesConf) { - if (subs) { + if (subs && sub.length) { downloadSubtitles(subs[0].SubDownloadLink, resource).then((subtitles) => { _play(resource, subtitles).finally(onVideoReady); resolve(resource, subtitles); @@ -398,7 +398,7 @@ $(document).ready(function() { $mediaSubtitlesResultsContainer.hide(); getSubtitles(resource).then((subs) => { - if (!subs) { + if (!subs || !subs.length) { $mediaSubtitlesMessage.text('No subtitles found'); resolve(); }