Skip to content

Commit

Permalink
fix(cdp): Handle if there are no logs (#24053)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Jul 29, 2024
1 parent 093559f commit 526c96e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin-server/src/cdp/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ export const prepareLogEntriesForClickhouse = (

const sortedLogs = logs.sort((a, b) => a.timestamp.toMillis() - b.timestamp.toMillis())

if (sortedLogs.length === 0) {
return []
}

// Start with a timestamp that is guaranteed to be before the first log entry
let previousTimestamp = sortedLogs[0].timestamp.minus(1)

Expand Down

0 comments on commit 526c96e

Please sign in to comment.