diff --git a/scraper/src/github-scraper/discussion.ts b/scraper/src/github-scraper/discussion.ts index a7eb456f..f415fb85 100644 --- a/scraper/src/github-scraper/discussion.ts +++ b/scraper/src/github-scraper/discussion.ts @@ -138,12 +138,14 @@ export async function scrapeDiscussions( endDate, startDate, ); - const parsedDiscussions = await parseDiscussionData( - allDiscussions, - endDate, - startDate, - ); - await saveDiscussionData(parsedDiscussions, dataDir); + if (allDiscussions) { + const parsedDiscussions = await parseDiscussionData( + allDiscussions, + endDate, + startDate, + ); + await saveDiscussionData(parsedDiscussions, dataDir); + } } catch (error: any) { throw new Error(`Error fetching discussions: ${error.message}`); }