From c3acf6f529462459b533b3731b569990ec3be511 Mon Sep 17 00:00:00 2001 From: yujiadong Date: Sat, 24 Jun 2023 05:44:51 +0000 Subject: [PATCH] =?UTF-8?q?fixed=2087b55a0=20from=20https://gitee.com/xuqi?= =?UTF-8?q?nfeng1996/arkui=5Face=5Fengine/pulls/14996=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?JsTextClock=E7=B1=BB=E5=9E=8B=E6=B7=B7=E6=B7=86=E6=BC=8F?= =?UTF-8?q?=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yujiadong Change-Id: I911da65efda0068518a41d165b23636293b80149 --- .../bridge/declarative_frontend/jsview/js_text_clock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/js_text_clock.cpp b/frameworks/bridge/declarative_frontend/jsview/js_text_clock.cpp index 1d0c0496a19..b9363c90ee8 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_text_clock.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_text_clock.cpp @@ -84,7 +84,7 @@ void JSTextClock::Create(const JSCallbackInfo& info) LOGE("hourWest args is invalid"); } auto controllerObj = optionsObject->GetProperty("controller"); - if (!controllerObj->IsUndefined() && !controllerObj->IsNull()) { + if (!controllerObj->IsUndefined() && !controllerObj->IsNull() && controllerObj->IsObject()) { auto* jsController = JSRef::Cast(controllerObj)->Unwrap(); if (jsController != nullptr) { if (controller) { @@ -95,7 +95,7 @@ void JSTextClock::Create(const JSCallbackInfo& info) } return; } - LOGE("controllerObj is nullptr or undefined"); + LOGE("controllerObj is nullptr or undefined or invalid"); } void JSTextClock::JSBind(BindingTarget globalObj) -- Gitee