From c892b7720246175453282f2ed43ec46e93bb7848 Mon Sep 17 00:00:00 2001 From: fupc90 Date: Mon, 14 Nov 2022 08:20:42 +0000 Subject: [PATCH] update interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp. Signed-off-by: fupc90 --- interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp b/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp index 46727c7e5..6ab20d052 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp @@ -40,7 +40,7 @@ static tuple GetJsFlags(napi_env env, const NFuncArg &funcArg) { int mode = O_RDONLY; bool succ = false; - if (funcArg.GetArgc() == NARG_CNT::TWO && NVal(env, funcArg[NARG_POS::SECOND]).TypeIs(napi_number)) { + if (funcArg.GetArgc() >= NARG_CNT::TWO && NVal(env, funcArg[NARG_POS::SECOND]).TypeIs(napi_number)) { tie(succ, mode) = NVal(env, funcArg[NARG_POS::SECOND]).ToInt32(); if (!succ) { UniError(EINVAL).ThrowErr(env); -- Gitee