From efa0d3eac53d3d3d8c352f5ccb48302f4c2eeb35 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 11 Dec 2016 10:08:46 -0800 Subject: [PATCH] script: fix potential uncaught error. --- lib/script/script.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/script/script.js b/lib/script/script.js index f11558c9..a3c24bfd 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -2976,6 +2976,9 @@ Script.prototype.getScripthashSigops = function getScripthashSigops(input) { if (!this.isScripthash()) return this.getSigops(true); + if (input.code.length === 0) + return 0; + for (i = 0; i < input.code.length; i++) { op = input.code[i];