From 6fc498309aa7b73929d4d7b3f3f6ab1fe5a18f23 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Wed, 8 Jun 2022 15:20:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0checkeachbundlestate=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- services/packagegroup/src/bundle_active_group_controller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/packagegroup/src/bundle_active_group_controller.cpp b/services/packagegroup/src/bundle_active_group_controller.cpp index 94f2272..2620786 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) { -- Gitee