diff --git a/www/blockly/blockly-main.ts b/www/blockly/blockly-main.ts index 078042cb..2c06c1de 100644 --- a/www/blockly/blockly-main.ts +++ b/www/blockly/blockly-main.ts @@ -167,7 +167,12 @@ module TDev { var text = s || ""; var xml = Blockly.Xml.textToDom(text); Blockly.mainWorkspace.clear(); - Blockly.Xml.domToWorkspace(Blockly.mainWorkspace, xml); + try { + Blockly.Xml.domToWorkspace(Blockly.mainWorkspace, xml); + } catch (e) { + console.error("Cannot load saved Blockly script. Too recent?"); + console.error(e); + } } function saveBlockly(): string {