diff --git a/services/src/fileoper/media_file_utils.cpp b/services/src/fileoper/media_file_utils.cpp index dcdd31e4407108f83d212b6098f2b3440a90a9c7..f8f59ab348e14831371f684c32573445a9c055e6 100644 --- a/services/src/fileoper/media_file_utils.cpp +++ b/services/src/fileoper/media_file_utils.cpp @@ -377,6 +377,10 @@ bool MediaFileUtils::GetFileInfo(shared_ptr resul result->GetString(mediaTableMap[index++].first, id); string uri; result->GetString(mediaTableMap[index++].first, uri); + if (uri.empty()) { + DEBUG_LOG("empty uri from medialibrary"); + uri = Media::MEDIALIBRARY_FILE_URI; + } string path = uri + "/" + id; fileInfo->SetPath(path); @@ -441,4 +445,4 @@ int MediaFileUtils::DoGetRoot(const std::string &name, const std::string &path, return SUCCESS; } } // namespace FileManagerService -} // namespace OHOS \ No newline at end of file +} // namespace OHOS