From aa6e09095afc43b0610fbcc3630b569531e57d44 Mon Sep 17 00:00:00 2001 From: "chenghuai.dtc" Date: Sat, 30 Apr 2022 13:04:12 +0800 Subject: [PATCH] fix: fix type check --- bridge/bindings/qjs/dom/element.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/bindings/qjs/dom/element.cc b/bridge/bindings/qjs/dom/element.cc index 6476e6efce..aa23486387 100644 --- a/bridge/bindings/qjs/dom/element.cc +++ b/bridge/bindings/qjs/dom/element.cc @@ -166,7 +166,7 @@ JSValue Element::insertAdjacentElement(JSContext* ctx, JSValue this_val, int arg JSValue positionValue = argv[0]; JSValue target = argv[1]; - if (!JS_IsNull(target)) { + if (!JS_IsObject(target)) { return JS_ThrowTypeError(ctx, "TypeError: Failed to execute 'insertAdjacentElement' on 'Element': parameter 2 is not of type 'Element'"); }