From 3a724d1b37463c89e8d43be72947ab3a1fb77d17 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Thu, 7 Jun 2018 14:55:16 +0200 Subject: [PATCH] Improved handling of unavailable/deleted vidble videos --- src/methods/vidbleVideo.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/methods/vidbleVideo.js b/src/methods/vidbleVideo.js index 7b81706..33ff2ad 100644 --- a/src/methods/vidbleVideo.js +++ b/src/methods/vidbleVideo.js @@ -18,6 +18,10 @@ function vidbleVideo(post) { const source = resource.attr('src'); const type = resource.attr('type'); + if(!source || !type) { + throw new Error(`Failed to retrieve (likely removed) vidble video '${post.host.id}'`); + } + return { album: null, items: [{