From: 최종헌/MDE Lab(SR)/삼성전자 Date: Mon, 13 Nov 2023 03:55:40 +0000 (+0900) Subject: Add error log when using --rm-all-app-profile option (#493) X-Git-Tag: accepted/tizen/8.0/unified/20231113.182916^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe54a0874e638069e35c77e5545090c6d2c7ebf1;p=platform%2Fcore%2Fdotnet%2Flauncher.git Add error log when using --rm-all-app-profile option (#493) --- diff --git a/NativeLauncher/tool/profile_common.cc b/NativeLauncher/tool/profile_common.cc index 80ae73d..c06f5d0 100644 --- a/NativeLauncher/tool/profile_common.cc +++ b/NativeLauncher/tool/profile_common.cc @@ -74,7 +74,6 @@ profile_error_e removeAppProfileData(const std::string& pkgId, void *user_data) std::string dataPath = *it + "/" + pkgId + "/data/"; if (!dataPath.empty() && exist(dataPath)) { std::string pDataFile = dataPath + PROFILE_BASENAME; - if (exist(pDataFile)) { if (!removeFile(pDataFile)) { _SERR("Failed to remove profile data file (%s).", pDataFile.c_str()); @@ -122,6 +121,10 @@ void removeAllAppProfileData() { // To reduce repeated getUserIds calls, get uids here. std::vector userAppRoots = getUserAppRoots(); + if (userAppRoots.empty()) { + _SERR("Failed to get app root directories of users"); + return; + } int ret = pkgmgrinfo_appinfo_get_installed_list(removeAppProfileListCb, &userAppRoots); if (ret != PMINFO_R_OK) { _SERR("Failed to get installed list");