From: Chris Duncan Date: Mon, 3 Aug 2026 06:44:23 +0000 (-0700) Subject: Validate block hash processing response. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=f761b8e4288f8de9dca8af3fa37351384aff4799;p=libnemo.git Validate block hash processing response. --- diff --git a/src/lib/block/index.ts b/src/lib/block/index.ts index ed5e453..07c6c4a 100644 --- a/src/lib/block/index.ts +++ b/src/lib/block/index.ts @@ -210,7 +210,7 @@ export class Block { block: this.toJSON() } const res = await rpc.post('process', data) - if (res.hash == null) { + if (res == null || typeof res !== 'object' || !('hash' in res) || typeof res.hash !== 'string') { throw new Error('Block could not be processed', { cause: res }) } return res.hash