mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-25 11:17:50 +01:00
fix(cdp): Handle if there are no logs (#24053)
This commit is contained in:
parent
093559fb92
commit
526c96e8a2
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user