From fefe63bd88905be9797a3c048186655d6ae13163 Mon Sep 17 00:00:00 2001 From: tianp Date: Mon, 4 Aug 2025 11:22:14 +0800 Subject: [PATCH] =?UTF-8?q?randomaccessfile=E7=B1=BBcreatereadstream?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianp Change-Id: I60182a9dde61b1292a3ae48c970529a680bf6ed0 --- .../mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp b/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp index f3172480b..b23843a48 100644 --- a/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp @@ -370,11 +370,13 @@ static ani_object CreateReadStream(ani_env *env, ani_string filePath, ani_object HILOGE("Cannot find class %s", className); return nullptr; } + ani_method ctor; if (ANI_OK != env->Class_FindMethod(cls, "", "Lstd/core/String;L@ohos/file/fs/ReadStreamOptions;:V", &ctor)) { HILOGE("Cannot find constructor method for class %s", className); return nullptr; } + ani_object obj; if (ANI_OK != env->Object_New(cls, ctor, &obj, filePath, options)) { HILOGE("New %s obj Failed", className); -- Gitee