From b1c9146835214332298292ee65cce35719a0f872 Mon Sep 17 00:00:00 2001 From: duansizhao Date: Wed, 11 Feb 2026 15:47:13 +0800 Subject: [PATCH] fix GetEntry bug Signed-off-by: duansizhao Change-Id: Id51e7a14af1ade7544af947f3b438a53b8a41f50 --- services/uripermmgr/src/upms_udmf_utils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/uripermmgr/src/upms_udmf_utils.cpp b/services/uripermmgr/src/upms_udmf_utils.cpp index ae63431357..484e100740 100644 --- a/services/uripermmgr/src/upms_udmf_utils.cpp +++ b/services/uripermmgr/src/upms_udmf_utils.cpp @@ -47,13 +47,13 @@ int32_t UDMFUtils::GetBatchData(const std::string &key, std::vector std::vector> records = unifiedDataset[i].GetRecords(); for (const auto &record : records) { auto fileEntry = record->GetEntry(UDMF_FILE_URI_ENTRY); - std::shared_ptr fileEntryObj = std::get>(fileEntry); - if (fileEntryObj == nullptr) { + auto fileEntryObjPtr = std::get_if>(&fileEntry); + if (fileEntryObjPtr == nullptr || *fileEntryObjPtr == nullptr) { TAG_LOGE(AAFwkTag::URIPERMMGR, "file entry obj null"); return ERR_UPMS_GET_ORI_URI_FAILED; } std::string oriUri; - fileEntryObj->GetValue(UDMF_ORI_URI, oriUri); + (*fileEntryObjPtr)->GetValue(UDMF_ORI_URI, oriUri); if (oriUri.empty()) { TAG_LOGE(AAFwkTag::URIPERMMGR, "get oriUri failed"); return ERR_UPMS_GET_ORI_URI_FAILED;