Skip to content

Commit

Permalink
Merge pull request #160 from my-flow/master
Browse files Browse the repository at this point in the history
Handle empty Vimeo lists gracefully (fix NPE)
  • Loading branch information
christianvuerings committed Jan 25, 2014
2 parents 2740a1f + cd3a7a2 commit d47a8a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/vimeo.js
Expand Up @@ -53,14 +53,16 @@ $.fn.lifestream.feeds.vimeo = function( config, callback ) {
var output = [];

// check for likes & parse
if ( response.query.results.videos[0].video.length > 0 ) {
if ( response.query.results.videos[0] != null &&
response.query.results.videos[0].video.length > 0 ) {
output = output.concat(parseVimeo(
response.query.results.videos[0].video
));
}

// check for uploads & parse
if ( response.query.results.videos[1].video.length > 0 ) {
if ( response.query.results.videos[1] != null &&
response.query.results.videos[1].video.length > 0 ) {
output = output.concat(
parseVimeo(response.query.results.videos[1].video, 'posted')
);
Expand Down

0 comments on commit d47a8a4

Please sign in to comment.