Skip to content

Commit

Permalink
Fix fetch title for bad URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Jul 13, 2018
1 parent e33f36a commit 7606b26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/utils/youtube-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const fetchYoutubeTrack = async (ytid, fields) => {

const fetchTitle = async function (ytid) {
let data = await fetchYoutubeTrack(ytid, 'items(id,snippet(title))&part=snippet');
return data.snippet.title
return data && data.snippet.title
}


Expand Down

0 comments on commit 7606b26

Please sign in to comment.