From 3b4a00ce464bd431dd9222c976fd1010735d96c6 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Tue, 7 Jun 2016 11:29:51 -0400 Subject: [PATCH] Add check for null `substackNum`, fix numbering --- src/engine/blocks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/blocks.js b/src/engine/blocks.js index ad4c8d1c7..896e9c8b4 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -56,9 +56,10 @@ Blocks.prototype.getSubstack = function (id, substackNum) { var block = this._blocks[id]; if (typeof block === 'undefined') return null; + if (!substackNum) substackNum = 1; var inputName = 'SUBSTACK'; - if (substackNum > 0) { + if (substackNum > 1) { inputName += substackNum; }