From 47e5a0e179d66a8fc78e62ea7ba5b3d2eaec4d32 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 5 Jun 2018 20:17:06 +1000 Subject: [PATCH] witnessScriptHash: fix null decompile leading to errors -- TODO: add test --- src/templates/witnessscripthash/input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/witnessscripthash/input.js b/src/templates/witnessscripthash/input.js index 0188048..c7fb98f 100644 --- a/src/templates/witnessscripthash/input.js +++ b/src/templates/witnessscripthash/input.js @@ -18,7 +18,7 @@ function check (chunks, allowIncomplete) { const witnessScriptChunks = bscript.decompile(witnessScript) // is witnessScript a valid script? - if (witnessScriptChunks.length === 0) return false + if (!witnessScriptChunks || witnessScriptChunks.length === 0) return false const witnessRawScriptSig = bscript.compile(chunks.slice(0, -1))