From 5f34f67fc5eb404f60d918660c65dcea4e771076 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Wed, 23 Jul 2014 20:08:53 +0300 Subject: [PATCH] Fixes an error when clicking on a thumbnail without video. --- app.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 447a76753..9711e8209 100644 --- a/app.js +++ b/app.js @@ -312,8 +312,15 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) { // Add click handler. container.onclick = function (event) { - VideoLayout.handleVideoThumbClicked( - $('#' + container.id + '>video').get(0).src); + /* + * FIXME It turns out that videoThumb may not exist (if there is no + * actual video). + */ + var videoThumb = $('#' + container.id + '>video').get(0); + + if (videoThumb) + VideoLayout.handleVideoThumbClicked(videoThumb.src); + event.preventDefault(); return false; };