File tree 1 file changed +6
-1
lines changed
static/app/components/replays 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,9 @@ export function CanvasReplayerPlugin(events: eventWithTime[]): ReplayPlugin {
174
174
* written to when replay is being played.
175
175
*/
176
176
function cloneCanvas ( id : number , node : HTMLCanvasElement ) {
177
+ if ( ! ( node instanceof HTMLCanvasElement ) ) {
178
+ return null ;
179
+ }
177
180
const cloneNode = node . cloneNode ( ) as HTMLCanvasElement ;
178
181
canvases . set ( id , cloneNode ) ;
179
182
document . adoptNode ( cloneNode ) ;
@@ -286,7 +289,9 @@ export function CanvasReplayerPlugin(events: eventWithTime[]): ReplayPlugin {
286
289
287
290
const img = containers . get ( e . data . id ) ;
288
291
if ( img ) {
289
- img . src = target . toDataURL ( ) ;
292
+ if ( target instanceof HTMLCanvasElement ) {
293
+ img . src = target . toDataURL ( ) ;
294
+ }
290
295
img . style . maxWidth = '100%' ;
291
296
img . style . maxHeight = '100%' ;
292
297
}
You can’t perform that action at this time.
0 commit comments