Skip to content

Commit

Permalink
fix: return undefined if worker is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed May 8, 2024
1 parent 1c946e4 commit 48e30b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/subsquid-network-squid/workers-graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ export function useWorkerByPeerId(peerId?: string) {
},
{
select: res => {
if (!res.workers.length) return;

return new BlockchainApiFullWorker({
worker: res.workers[0],
address,
Expand Down

0 comments on commit 48e30b6

Please sign in to comment.