From 8409ff8c435d20e9e554b1f7e878f4200d0579c5 Mon Sep 17 00:00:00 2001 From: Kenichi Asai Date: Mon, 15 Apr 2019 16:48:52 +0900 Subject: [PATCH] catch type error in connection.js to partly cope with issue #10 --- core/connection.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/connection.js b/core/connection.js index a46c6450f..7bbdd34eb 100644 --- a/core/connection.js +++ b/core/connection.js @@ -267,7 +267,13 @@ Blockly.Connection.prototype.connect_ = function(childConnection) { if (this.typeExprEnabled()) { var rootBlock = parentBlock.getRootBlock(); - rootBlock.updateTypeInference(); + try { + rootBlock.updateTypeInference(); + } catch (e) { + var sourceBlock = this.getSourceBlock(); + var mainWorkspace = sourceBlock.workspace.getMainWorkspace(); + mainWorkspace.undo(false); + } } if (event) {