diff --git a/source/binding/NodeJS/release/maa-node/src/tasker.ts b/source/binding/NodeJS/release/maa-node/src/tasker.ts index 74749f3e1..1859085ae 100644 --- a/source/binding/NodeJS/release/maa-node/src/tasker.ts +++ b/source/binding/NodeJS/release/maa-node/src/tasker.ts @@ -196,8 +196,8 @@ export class TaskerBase { } } - latest_node(task: string) { - return maa.tasker_get_latest_node(this.handle, task) + latest_node(node: string) { + return maa.tasker_get_latest_node(this.handle, node) } } diff --git a/source/binding/NodeJS/src/instance/tasker.cpp b/source/binding/NodeJS/src/instance/tasker.cpp index a85049711..0c039f93f 100644 --- a/source/binding/NodeJS/src/instance/tasker.cpp +++ b/source/binding/NodeJS/src/instance/tasker.cpp @@ -144,7 +144,7 @@ std::optional> tasker_get_node_detail(Napi::External info, MaaNodeId id) { StringBuffer name; - MaaRecoId reco_id; - MaaBool completed; + MaaRecoId reco_id = MaaInvalidId; + MaaBool completed = false; if (MaaTaskerGetNodeDetail(info.Data()->handle, id, name, &reco_id, &completed)) { return std::make_tuple(name.str(), reco_id, completed); } @@ -181,7 +181,7 @@ std::optional, MaaStatus>> } StringBuffer entry; std::vector nodes(node_size); - MaaStatus status; + MaaStatus status = MaaStatus_Invalid; if (MaaTaskerGetTaskDetail(info.Data()->handle, id, entry, nodes.data(), &node_size, &status)) { return std::make_tuple(entry.str(), nodes, status); } @@ -192,7 +192,7 @@ std::optional, MaaStatus>> std::optional tasker_get_latest_node(Napi::External info, std::string name) { - MaaNodeId latest_id; + MaaNodeId latest_id = MaaInvalidId; if (MaaTaskerGetLatestNode(info.Data()->handle, name.c_str(), &latest_id)) { return latest_id; }