From b1916d6043c3cf58488ef1b24c79fe5b12da968a Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 28 Jul 2013 10:41:08 +0000 Subject: [PATCH] missing data fix for youtube --- modules/youtube/youtube.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/youtube/youtube.js b/modules/youtube/youtube.js index 4b23534..b3fd342 100644 --- a/modules/youtube/youtube.js +++ b/modules/youtube/youtube.js @@ -65,6 +65,10 @@ var youtube = function(dbot) { 'numDislikes': 0 }; } + if(!_.has(v, 'yt$statistics')) { + v['yt$statistics'] = { 'viewCount': 0 }; + } + callback(dbot.t('yt_video', { 'title': v.title['$t'], 'plays': v['yt$statistics'].viewCount,