diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp index 98d2569f11ee6da52fe8294ff666d8ae1781a249..3948fcd01f925be849adf6d7555527e34166d94e 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp @@ -1206,7 +1206,7 @@ ErrCode BundleMgrProxy::GetAbilityLabel(const std::string &bundleName, const std APP_LOGI("begin to GetAbilityLabel of %{public}s", bundleName.c_str()); if (bundleName.empty() || moduleName.empty() || abilityName.empty()) { APP_LOGE("fail to GetAbilityLabel due to params empty"); - return ERR_BUNDLE_MANAGER_INVALID_PARAMETER; + return ERR_BUNDLE_MANAGER_PARAM_ERROR; } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { @@ -3195,7 +3195,7 @@ ErrCode BundleMgrProxy::GetMediaData(const std::string &bundleName, const std::s APP_LOGD("begin to get media data of %{public}s, %{public}s", bundleName.c_str(), abilityName.c_str()); if (bundleName.empty() || abilityName.empty()) { APP_LOGE("fail to GetMediaData due to params empty"); - return ERR_APPEXECFWK_PARCEL_ERROR; + return ERR_BUNDLE_MANAGER_PARAM_ERROR; } MessageParcel data; diff --git a/interfaces/kits/js/bundle_manager/bundle_manager.cpp b/interfaces/kits/js/bundle_manager/bundle_manager.cpp index d02b69c9bea600ab225bf8cb8c5a274c5f6b545d..7ffd9abcfdf53721ee48d0b9555320ef1587bde7 100644 --- a/interfaces/kits/js/bundle_manager/bundle_manager.cpp +++ b/interfaces/kits/js/bundle_manager/bundle_manager.cpp @@ -617,6 +617,10 @@ static ErrCode InnerGetAbilityIcon(const std::string &bundleName, const std::str APP_LOGE("CommonFunc::GetBundleMgr failed."); return ERROR_SYSTEM_ABILITY_NOT_FOUND; } + if (bundleName.empty() || moduleName.empty() || abilityName.empty()) { + APP_LOGE("GetAbilityIcon check param failed."); + return ERROR_PARAM_CHECK_ERROR; + } std::unique_ptr mediaDataPtr = nullptr; size_t len = 0; ErrCode ret = bundleMgr->GetMediaData(bundleName, moduleName, abilityName, mediaDataPtr, len);