Skip to content

Commit 4333364

Browse files
committed
[scramjet/rpc] fix throwing on null response
1 parent a29255c commit 4333364

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/scramjet/packages/rpc/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ export class RpcHelper<
5858
const method = dt.$method as keyof Local;
5959
const args = dt.$args as Local[typeof method][0];
6060
(this.methods[method] as any)(args)
61-
.then(([res, transfer]) => {
61+
.then((r: any) => {
6262
this.sendRaw(
6363
{
6464
[this.id]: {
6565
$type: "response",
6666
$token: dt.$token,
67-
$data: res,
67+
$data: r?.[0],
6868
},
6969
},
70-
transfer
70+
r?.[1]
7171
);
7272
})
7373
.catch((err: any) => {

0 commit comments

Comments
 (0)