From d2c58354f634691526fcdc672f1cb90ca6a54939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8A=E5=AE=98=E6=99=AF=E5=A8=81?= Date: Wed, 16 Apr 2025 11:50:07 +0800 Subject: [PATCH] =?UTF-8?q?absSharedResultSet=E5=86=85=E5=AD=98=E9=87=8A?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 上官景威 --- .../main/rdb/src/cm_rdb_data_manager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/services/cert_manager_standard/cert_manager_engine/main/rdb/src/cm_rdb_data_manager.cpp b/services/cert_manager_standard/cert_manager_engine/main/rdb/src/cm_rdb_data_manager.cpp index 3909870..e71a019 100644 --- a/services/cert_manager_standard/cert_manager_engine/main/rdb/src/cm_rdb_data_manager.cpp +++ b/services/cert_manager_standard/cert_manager_engine/main/rdb/src/cm_rdb_data_manager.cpp @@ -91,9 +91,15 @@ std::shared_ptr CmRdbDataManager::QueryData(const NativeRdb::AbsRdbPredicates queryPredicates(rdbConfig_.tableName); queryPredicates.EqualTo(keyColumn, primKey); - auto absSharedResultSet = rdbStore->Query(queryPredicates, std::vector()); - if ((absSharedResultSet == nullptr) || (!absSharedResultSet->HasBlock())) { - CM_LOG_E("absSharedResultSet is invalid"); + std::shared_ptr absSharedResultSet = + rdbStore->Query(queryPredicates, std::vector()); + if (absSharedResultSet == nullptr) { + CM_LOG_E("absSharedResultSet is nullptr"); + return nullptr; + } + if (!absSharedResultSet->HasBlock()) { + CM_LOG_E("absSharedResultSet query failed"); + absSharedResultSet->Close(); return nullptr; } return absSharedResultSet; -- Gitee