Skip to content

Commit

Permalink
Handle nullable values while scraping discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
dgparmar14 committed Jul 22, 2024
1 parent 61c0521 commit 1a16748
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scraper/src/github-scraper/discussion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down

0 comments on commit 1a16748

Please sign in to comment.