Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
check for null too
Browse files Browse the repository at this point in the history
Co-Authored-By: PikachuEXE <pikachuexe@gmail.com>
  • Loading branch information
ChunkyProgrammer and PikachuEXE committed Sep 14, 2022
1 parent dde9ced commit 5da8f00
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/youtube-grabber.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ class YoutubeGrabber {
const channelMetaData = channelPageDataResponse.metadata.channelMetadataRenderer
const channelHeaderData = channelPageDataResponse.header.c4TabbedHeaderRenderer
const headerTabs = channelPageDataResponse.contents.twoColumnBrowseResultsRenderer.tabs
const channelTabs = headerTabs.filter(tab => {
return typeof tab.tabRenderer !== 'undefined'
}).map(tab => {
return tab.tabRenderer.title
})
const channelTabs = headerTabs
.filter(tab => tab.tabRenderer !== undefined && tab.tabRenderer !== null)
.map(tab => tab.tabRenderer.title)

const channelsTab = headerTabs.filter((data) => {
if (typeof data.tabRenderer !== 'undefined') {
return data.tabRenderer.title === 'Channels'
Expand Down

0 comments on commit 5da8f00

Please sign in to comment.