diff --git a/.changeset/fluffy-melons-listen.md b/.changeset/fluffy-melons-listen.md new file mode 100644 index 0000000000..7a72904df4 --- /dev/null +++ b/.changeset/fluffy-melons-listen.md @@ -0,0 +1,7 @@ +--- +"@human-protocol/sdk": patch +--- + +### Changed + +Fix EscrowUtils.getEscrow to return null if escrow is not found diff --git a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts index 0a68944b2e..350bb91ab0 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts @@ -1958,9 +1958,12 @@ export class EscrowUtils { GET_ESCROW_BY_ADDRESS_QUERY(), { escrowAddress: escrowAddress.toLowerCase() } ); + if (!escrow) { + return null; + } escrow.chainId = networkData.chainId; - return escrow || null; + return escrow; } /**