From cbc7e88cde9b0ad604f9e327551717241ce9d0f0 Mon Sep 17 00:00:00 2001 From: David Newell Date: Mon, 17 Jun 2024 11:19:38 +0100 Subject: [PATCH] fix: prevent canvas error (#23009) --- .../session-recordings/player/rrweb/canvas/canvas-plugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/scenes/session-recordings/player/rrweb/canvas/canvas-plugin.ts b/frontend/src/scenes/session-recordings/player/rrweb/canvas/canvas-plugin.ts index b812c254fdd03..11e2484cc2a5c 100644 --- a/frontend/src/scenes/session-recordings/player/rrweb/canvas/canvas-plugin.ts +++ b/frontend/src/scenes/session-recordings/player/rrweb/canvas/canvas-plugin.ts @@ -74,8 +74,10 @@ export const CanvasReplayerPlugin = (events: eventWithTime[]): ReplayPlugin => { return } - target.width = source.clientWidth - target.height = source.clientHeight + if (source) { + target.width = source.clientWidth + target.height = source.clientHeight + } await canvasMutation({ event: e,