diff --git a/services/packagegroup/src/bundle_active_group_controller.cpp b/services/packagegroup/src/bundle_active_group_controller.cpp index 94f22724fbb60244fc7c884d838cbe7d041993e2..262078645353b0188561f2479677bd78c48543c7 100644 --- a/services/packagegroup/src/bundle_active_group_controller.cpp +++ b/services/packagegroup/src/bundle_active_group_controller.cpp @@ -156,6 +156,10 @@ bool BundleActiveGroupController::CheckEachBundleState(const int32_t userId) for (auto oneBundle : allBundlesForUser) { bundleNamesOfUser.push_back(oneBundle.bundleName); } + if (bundleNamesOfUser.empty()) { + BUNDLE_ACTIVE_LOGE("there is no bundle install on user ID %{public}d", userId); + return false; + } sptr timer = MiscServices::TimeServiceClient::GetInstance(); int64_t bootBasedTimeStamp = timer->GetBootTimeMs(); for (auto oneBundleName : bundleNamesOfUser) {