From 8bb7ae436fdc115911253864103d09725ac6fbab Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 20 Sep 2015 17:50:23 +0100 Subject: [PATCH] dont fail if layer does not exist --- static/js/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/utils.js b/static/js/utils.js index 2f5464419..73b582176 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2047,7 +2047,7 @@ pandora.getVideoOptions = function(data) { options.annotations[i] = Ox.extend({}, layer, { title: Ox._(layer.title), item: Ox._(layer.item), - items: data.layers[layer.id].map(function(annotation) { + items: data.layers[layer.id] ? data.layers[layer.id].map(function(annotation) { annotation.duration = Math.abs(annotation.out - annotation['in']); annotation.editable = annotation.editable || annotation.user == pandora.user.username @@ -2058,7 +2058,7 @@ pandora.getVideoOptions = function(data) { return Ox.getLanguageNameByCode(language); }); return annotation; - }) + }) : [] }); }); data.videoRatio = data.videoRatio || pandora.site.video.previewRatio;