Skip to content

Commit

Permalink
Check if account exists or not (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
ittechhunter authored May 4, 2024
1 parent c1937e2 commit 24a28f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,16 @@ const RpcManager = {
);

const response = await result.json();
const parsedResp = RpcManager.parseResponse(response);

if (!parsedResp[account]) {
log.error(`Are you sure this account exists? : ${account}`);
return [];
}

const {
[account]: { widget: keys },
} = RpcManager.parseResponse(response);
} = parsedResp;

return Object.keys(keys || []);
},
Expand Down

0 comments on commit 24a28f2

Please sign in to comment.