Skip to content

Commit

Permalink
fix: Check for the event generally being truthy (#17942)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Oct 12, 2023
1 parent 4a0796d commit 2bd2b2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ export class SessionRecordingIngester {
})
}

const invalidEvents: RRWebEvent[] = []
const invalidEvents: any[] = []
const events: RRWebEvent[] = $snapshot_items.filter((event: any) => {
if (!event.timestamp) {
if (!event || !event.timestamp) {
invalidEvents.push(event)
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ describe('ingester', () => {
},
],
})

const parsedMessage3 = await ingester.parseKafkaMessage(createMessage([null]), () => Promise.resolve(1))
expect(parsedMessage3).toEqual(undefined)
})
})

Expand Down

0 comments on commit 2bd2b2c

Please sign in to comment.