diff --git a/services/backup_sa/src/module_ipc/sub_service.cpp b/services/backup_sa/src/module_ipc/sub_service.cpp index 51a6b972bb88286a258c1bba61553a9b59a01f88..da71f1b8182846aed1d28c9ac2e56fc1e7f523b4 100644 --- a/services/backup_sa/src/module_ipc/sub_service.cpp +++ b/services/backup_sa/src/module_ipc/sub_service.cpp @@ -1399,7 +1399,12 @@ ErrCode Service::TryToConnectExt(const std::string& bundleName, sptrSetCallback(callConnected); extConnection->SetCallDied(callDied); - AAFwk::Want want = CreateConnectWant(bundleName); + AAFwk::Want want; + try { + want = CreateConnectWant(bundleName); + } catch (const BError &e) { + return e.GetCode(); + } ErrCode err = extConnection->ConnectBackupExtAbility(want, GetUserIdDefault(), false); if (err != BError(BError::Codes::OK)) { HILOGE("ConnectBackupExtAbility failed, bundleName:%{public}s, ret:%{public}d", bundleName.c_str(), err);