From d8adaef38ea40ae655d7b76d0acf202b2a44cd83 Mon Sep 17 00:00:00 2001 From: fengyang Date: Thu, 24 Apr 2025 11:03:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fengyang --- services/common/src/bundle_active_core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/common/src/bundle_active_core.cpp b/services/common/src/bundle_active_core.cpp index 35f2677..38f9eee 100644 --- a/services/common/src/bundle_active_core.cpp +++ b/services/common/src/bundle_active_core.cpp @@ -546,6 +546,10 @@ void BundleActiveCore::OnUserRemoved(const int32_t userId) if (it == userStatServices_.end()) { return; } + if (userId < 0) { + BUNDLE_ACTIVE_LOGE("error userId %{public}d", userId); + return 0; + } userStatServices_[userId]->OnUserRemoved(); userStatServices_[userId].reset(); userStatServices_.erase(userId); -- Gitee