From 1910a90e4227c94834bcac2780b31be4fe682b3b Mon Sep 17 00:00:00 2001 From: huaqingsimeng Date: Mon, 25 Sep 2023 14:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD=E6=81=A2=E5=A4=8D=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=94=A8=E4=BE=8B=E9=80=BB=E8=BE=91=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huaqingsimeng --- utils/src/b_json/b_json_entity_extension_config.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/src/b_json/b_json_entity_extension_config.cpp b/utils/src/b_json/b_json_entity_extension_config.cpp index 0b63368d9..726c1ed30 100644 --- a/utils/src/b_json/b_json_entity_extension_config.cpp +++ b/utils/src/b_json/b_json_entity_extension_config.cpp @@ -134,6 +134,10 @@ string BJsonEntityExtensionConfig::GetJSonSource(string_view jsonFromRealWorld, append(bundleName). append("/"). append(BConstants::BACKUP_CONFIG_JSON); + if (access(jsonFilePath.c_str(), F_OK) != 0) { + HILOGI("Failed to access jsonFilePath : %{public}s", jsonFilePath.c_str()); + return string(jsonFromRealWorld); + } return BFile::ReadFile(UniqueFd(open(jsonFilePath.c_str(), O_RDONLY))).get(); } } // namespace OHOS::FileManagement::Backup -- Gitee