diff --git a/interfaces/kits/js/file_uri/get_uri_from_path.cpp b/interfaces/kits/js/file_uri/get_uri_from_path.cpp index ea23b11186ec880a1e82fc574ab450d66e6ce677..0c84d6558cc108d914ae1aba57b0b8d69c6ea2d2 100644 --- a/interfaces/kits/js/file_uri/get_uri_from_path.cpp +++ b/interfaces/kits/js/file_uri/get_uri_from_path.cpp @@ -96,7 +96,7 @@ napi_value GetUriFromPath::Sync(napi_env env, napi_callback_info info) } string realPath = path.get(); - if (!NormalizePath(realPath)) { + if (!realPath.empty() && !NormalizePath(realPath)) { LOGE("GetUriFromPath::NormalizePath failed!"); NError(EINVAL).ThrowErr(env); return nullptr;