Skip to content

Commit

Permalink
Better null-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
FlaminSarge committed Nov 2, 2024
1 parent 8f59f9a commit 0a63555
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ts/chat-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const splitRunsByNewline = (runs: Ytc.ParsedRun[], maxSplit: number = -1): Ytc.P
}

const parseChatSummary = (renderer: Ytc.AddChatItem, isEphemeral: boolean | undefined, bannerTimeoutMs: number | undefined): Ytc.ParsedSummary | undefined => {
if (!renderer.liveChatBannerChatSummaryRenderer) {
return;
}
const baseRenderer = renderer.liveChatBannerChatSummaryRenderer!;
const runs = parseMessageRuns(renderer.liveChatBannerChatSummaryRenderer?.chatSummary.runs);
const splitRuns = splitRunsByNewline(runs, 2);
Expand Down

0 comments on commit 0a63555

Please sign in to comment.