From 17b1d4db1df4e701845d1e3254b24eaeb6aba960 Mon Sep 17 00:00:00 2001 From: wangdengejia Date: Fri, 3 Dec 2021 18:22:38 +0800 Subject: [PATCH] IssueNo:#I4L1U1 Description:Solve the crash problem Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangdengejia Change-Id: I70d33fd1886f7152b50d501b4b48906aedc5ccfd --- .../src/gt_bundle_manager_service.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index 3ef6224..79a7bc0 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -268,6 +268,12 @@ bool GtManagerService::RegisterInstallerCallback(InstallerCallback installerCall void GtManagerService::InstallPreBundle(List systemPathList, InstallerCallback installerCallback) { + if (!BundleUtil::IsDir(JSON_PATH_NO_SLASH_END)) { + BundleUtil::MkDirs(JSON_PATH_NO_SLASH_END); + InstallAllSystemBundle(installerCallback); + RemoveSystemAppPathList(&systemPathList); + return; + } // get third system bundle uninstall record cJSON *uninstallRecord = BundleUtil::GetJsonStream(UNINSTALL_THIRD_SYSTEM_BUNDLE_JSON); if (uninstallRecord == nullptr) { @@ -282,13 +288,6 @@ void GtManagerService::InstallPreBundle(List systemPathList, // scan third apps ScanThirdApp(INSTALL_PATH, &systemPathList_); - - if (!BundleUtil::IsDir(JSON_PATH_NO_SLASH_END)) { - BundleUtil::MkDirs(JSON_PATH_NO_SLASH_END); - InstallAllSystemBundle(installerCallback); - RemoveSystemAppPathList(&systemPathList); - return; - } for (auto node = systemPathList.Begin(); node != systemPathList.End(); node = node->next_) { ToBeInstalledApp *toBeInstalledApp = node->value_; if (!BundleUtil::IsFile(toBeInstalledApp->path) ||