diff --git a/interfaces/kits/js/src/mod_fs/properties/open.cpp b/interfaces/kits/js/src/mod_fs/properties/open.cpp index c1ec37711d4b877bbb0f991eb15f4a87724dae38..3be355d95bc78cfc8d244fdf6b3e2005d8f1b2e3 100644 --- a/interfaces/kits/js/src/mod_fs/properties/open.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/open.cpp @@ -163,8 +163,8 @@ napi_value Open::Sync(napi_env env, napi_callback_info info) if (uriType == SCHEME_FILE) { AppFileService::ModuleFileUri::FileUri fileUri(pathStr); pathStr = fileUri.GetRealPath(); - if ((bundleName == MEDIA && pathStr.find(".") == string::npos) || - access(pathStr.c_str(), F_OK) != 0) { + if (bundleName == MEDIA && (pathStr.find(".") == string::npos || + access(pathStr.c_str(), F_OK) != 0)) { int ret = OpenFileByDatashare(uri.ToString(), mode); if (ret >= 0) { auto file = InstantiateFile(env, ret, uri.ToString(), true).val_; @@ -223,8 +223,8 @@ static NError AsyncCbExec(shared_ptr arg, string path, unsigne if (uriType == SCHEME_FILE) { AppFileService::ModuleFileUri::FileUri fileUri(path); pathStr = fileUri.GetRealPath(); - if ((bundleName == MEDIA && pathStr.find(".") == string::npos) || - access(pathStr.c_str(), F_OK) != 0) { + if (bundleName == MEDIA && (pathStr.find(".") == string::npos || + access(pathStr.c_str(), F_OK) != 0)) { int ret = OpenFileByDatashare(path, mode); if (ret >= 0) { arg->fd = ret;