From 2b2707f7c4b1588b632ba4fd49e10fe2cb6bc21d Mon Sep 17 00:00:00 2001 From: Ni55aN Date: Sat, 12 Oct 2024 19:13:30 +0300 Subject: [PATCH] fix: prevent error on removing if the holder has been cleared --- src/content.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index 126cad0..41c743e 100644 --- a/src/content.ts +++ b/src/content.ts @@ -32,6 +32,8 @@ export class Content { } remove(element: HTMLElement) { - this.holder.removeChild(element) + if (this.holder.contains(element)) { + this.holder.removeChild(element) + } } }