From 34c29652d9fb9d1cfdd60669d8878a50c3d89148 Mon Sep 17 00:00:00 2001 From: Egozi Date: Tue, 14 Nov 2023 12:26:02 +0200 Subject: [PATCH] Update Clipboard.ts --- src/utils/dataTransfer/Clipboard.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/dataTransfer/Clipboard.ts b/src/utils/dataTransfer/Clipboard.ts index a26be281..3ea2de94 100644 --- a/src/utils/dataTransfer/Clipboard.ts +++ b/src/utils/dataTransfer/Clipboard.ts @@ -148,7 +148,7 @@ export function attachClipboardStubToView(window: Window & typeof globalThis) { } export function resetClipboardStubOnView(window: Window & typeof globalThis) { - if (isClipboardStub(window.navigator.clipboard)) { + if (isClipboardStub(window?.navigator.clipboard)) { window.navigator.clipboard[ClipboardStubControl].resetClipboardStub() } } @@ -156,7 +156,7 @@ export function resetClipboardStubOnView(window: Window & typeof globalThis) { export function detachClipboardStubFromView( window: Window & typeof globalThis, ) { - if (isClipboardStub(window.navigator.clipboard)) { + if (isClipboardStub(window?.navigator.clipboard)) { window.navigator.clipboard[ClipboardStubControl].detachClipboardStub() } }