Skip to content

Commit

Permalink
fix: prevent error for undefined subtitleList
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 9, 2023
1 parent f88e2dd commit 8ca9c06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/youtube/fetchYoutubeSubtitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function fetchYoutubeSubtitle(
shouldShowTimestamp: boolean | undefined
) {
const { title, subtitleList } = await fetchYoutubeSubtitleUrls(videoId);
if (subtitleList?.length <= 0) {
if (!subtitleList || subtitleList?.length <= 0) {
return { title, subtitlesArray: null };
}
const betterSubtitle =
Expand Down

0 comments on commit 8ca9c06

Please sign in to comment.