From e63fabd62dae7a3d1af3d256ceec080a38479934 Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Thu, 5 May 2022 14:28:41 +0800 Subject: [PATCH 1/2] Signed-off-by: lovechinamo Changes to be committed: --- services/src/input_method_system_ability.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index 50358584e..f8f57a5b6 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -777,7 +777,15 @@ namespace MiscServices { } if (securityImeFlag) { InputMethodProperty *securityIme = setting->GetSecurityInputMethod(); + if (securityIme == nullptr) { + IMSA_HILOGI("InputMethodSystemAbility::OnPackageAdded securityIme is nullptr"); + return ErrorCode::ERROR_NULL_POINTER; + } InputMethodProperty *defaultIme = setting->GetCurrentInputMethod(); + if (defaultIme == nullptr) { + IMSA_HILOGI("InputMethodSystemAbility::OnPackageAdded defaultIme is nullptr"); + return ErrorCode::ERROR_NULL_POINTER; + } GetUserSession(userId)->ResetIme(defaultIme, securityIme); PerUserSession *session = GetUserSession(userId); if (session == nullptr) { -- Gitee From 2e6b31721b62e27c36c46cc8d32285def9ef33d3 Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Thu, 5 May 2022 16:45:30 +0800 Subject: [PATCH 2/2] Signed-off-by: lovechinamo Changes to be committed: modified: services/src/input_method_system_ability.cpp --- services/src/input_method_system_ability.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index f8f57a5b6..20886f298 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -777,16 +777,7 @@ namespace MiscServices { } if (securityImeFlag) { InputMethodProperty *securityIme = setting->GetSecurityInputMethod(); - if (securityIme == nullptr) { - IMSA_HILOGI("InputMethodSystemAbility::OnPackageAdded securityIme is nullptr"); - return ErrorCode::ERROR_NULL_POINTER; - } InputMethodProperty *defaultIme = setting->GetCurrentInputMethod(); - if (defaultIme == nullptr) { - IMSA_HILOGI("InputMethodSystemAbility::OnPackageAdded defaultIme is nullptr"); - return ErrorCode::ERROR_NULL_POINTER; - } - GetUserSession(userId)->ResetIme(defaultIme, securityIme); PerUserSession *session = GetUserSession(userId); if (session == nullptr) { IMSA_HILOGI("InputMethodSystemAbility::OnPackageAdded session is nullptr"); -- Gitee