From 64c002029d4d1dbcbf68c1e44be2e190baf5e508 Mon Sep 17 00:00:00 2001 From: zhaogan Date: Thu, 17 Aug 2023 16:46:32 +0800 Subject: [PATCH] =?UTF-8?q?Issue:=20#I7U0SJ=20Description:=E5=AF=B9samgr?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=88=A4=E7=A9=BA=20Sig:=20SIG=5FApplicaiton?= =?UTF-8?q?Framework=20Feature=20or=20Bugfix:=20Feature=20Binary=20Source:?= =?UTF-8?q?=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaogan --- .../kits/js/distributebundlemgr/distributed_bundle_mgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/interfaces/kits/js/distributebundlemgr/distributed_bundle_mgr.cpp b/interfaces/kits/js/distributebundlemgr/distributed_bundle_mgr.cpp index 17915b0..4d2315d 100644 --- a/interfaces/kits/js/distributebundlemgr/distributed_bundle_mgr.cpp +++ b/interfaces/kits/js/distributebundlemgr/distributed_bundle_mgr.cpp @@ -72,7 +72,10 @@ static OHOS::sptr GetDistributedBundleMgr() { APP_LOGI("GetDistributedBundleMgr"); auto samgr = OHOS::SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - // OHOS::sptr remoteObject; + if (samgr == nullptr) { + APP_LOGE("GetSystemAbilityManager failed, samgr is nullptr."); + return nullptr; + } auto remoteObject = samgr->GetSystemAbility(OHOS::DISTRIBUTED_BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); return OHOS::iface_cast(remoteObject); } -- Gitee