Skip to content

Commit

Permalink
fix: actually check the latestBlockhash if it's null
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansonhkg committed Apr 17, 2024
1 parent 1c786a9 commit 389bcc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/lib/lit-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,13 @@ export class LitCore {
getLatestBlockhash = async (): Promise<string> => {
await this.connect();

return this.latestBlockhash as string;
if (!this.latestBlockhash) {
throw new Error(
`latestBlockhash is not available. Received: "${this.latestBlockhash}"`
);
}

return this.latestBlockhash;
};

/**
Expand Down

0 comments on commit 389bcc0

Please sign in to comment.