diff --git a/frameworks/napi/power/power.cpp b/frameworks/napi/power/power.cpp index 8dcc450f496e18989bd4f74efe3bce3b715d374c..46d9213ed65f8681a63b4f80b29e3ab74fd96203 100644 --- a/frameworks/napi/power/power.cpp +++ b/frameworks/napi/power/power.cpp @@ -77,7 +77,7 @@ void Power::IsScreenOnCallBack(napi_env env, std::unique_ptr(data); @@ -102,7 +102,8 @@ void Power::IsScreenOnCallBack(napi_env env, std::unique_ptr(asCallbackInfoPtr.get()), &asCallbackInfoPtr->asyncWork); - if (napi_ok == napi_queue_async_work_with_qos(env, asCallbackInfoPtr->asyncWork, napi_qos_utility)) { + if (napi_ok == napi_queue_async_work_with_qos(env, asCallbackInfoPtr->asyncWork, napi_qos_utility) + && ret == napi_ok) { asCallbackInfoPtr.release(); } }