Skip to content

Commit

Permalink
Fix youtube api guard
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Jul 13, 2018
1 parent baaf053 commit d710cb1
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 @@ -29,7 +29,7 @@ const fetchTitle = async function (ytid) {
const fetchTrackAvailability = async function (ytid) {
// let data = await fetchYoutubeTrack(ytid, 'items(id,status)&part=status')
let data = await fetchYoutubeTrack(ytid, 'items(id,snippet(title))&part=snippet');
return Boolean(data.snippet.title)
return Boolean(data && data.snippet.title)
}

export {fetchTitle, fetchTrackAvailability};

0 comments on commit d710cb1

Please sign in to comment.