add ime check for getInputMethodAbility

Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
zhaolinglan 2023-04-21 19:12:36 +08:00
parent 0ac759f8b1
commit c5a52dd7d5
2 changed files with 3 additions and 3 deletions

View File

@ -137,7 +137,7 @@ napi_value JsInputMethodEngineSetting::JsConstructor(napi_env env, napi_callback
napi_value thisVar = nullptr;
NAPI_CALL(env, napi_get_cb_info(env, cbinfo, nullptr, nullptr, &thisVar, nullptr));
auto setting = GetInputMethodEngineSetting();
if (setting == nullptr || InitInputMethodSetting()) {
if (setting == nullptr || !InitInputMethodSetting()) {
IMSA_HILOGE("failed to get setting");
napi_value result = nullptr;
napi_get_null(env, &result);

View File

@ -117,8 +117,8 @@ napi_value JsKeyboardDelegateSetting::JsConstructor(napi_env env, napi_callback_
napi_value thisVar = nullptr;
NAPI_CALL(env, napi_get_cb_info(env, cbinfo, nullptr, nullptr, &thisVar, nullptr));
auto delegate = GetKeyboardDelegateSetting();
if (delegate == nullptr || InitKeyboardDelegate()) {
IMSA_HILOGE("get delegate nullptr");
if (delegate == nullptr || !InitKeyboardDelegate()) {
IMSA_HILOGE("failed to get delegate");
napi_value result = nullptr;
napi_get_null(env, &result);
return result;