From 0076fdd82ef7ff3d4c1625f0c2cfb913bf32f034 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Thu, 7 Jul 2022 14:17:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BF=E9=97=AErdbstore?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E5=AF=BC=E8=87=B4=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?crash=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- services/common/src/bundle_active_usage_database.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/common/src/bundle_active_usage_database.cpp b/services/common/src/bundle_active_usage_database.cpp index 0035507..6cbef5a 100644 --- a/services/common/src/bundle_active_usage_database.cpp +++ b/services/common/src/bundle_active_usage_database.cpp @@ -787,6 +787,10 @@ pair BundleActiveUsageDatabase::GetDurationData() void BundleActiveUsageDatabase::FlushPackageInfo(uint32_t databaseType, const BundleActivePeriodStats &stats) { shared_ptr rdbStore = GetBundleActiveRdbStore(databaseType); + if (rdbStore == nullptr) { + BUNDLE_ACTIVE_LOGE("rdbStore is nullptr"); + return; + } string tableName = PACKAGE_LOG_TABLE + to_string(stats.beginTime_); int32_t changeRow = BUNDLE_ACTIVE_FAIL; int64_t outRowId = BUNDLE_ACTIVE_FAIL; -- Gitee