From 713397b0082190f9e44ad6d9f2a2b183bafc8694 Mon Sep 17 00:00:00 2001 From: Brian Geppert Date: Sun, 7 Dec 2014 19:19:35 -0600 Subject: [PATCH] Don't crash on prompt cancel. --- core/field_textinput.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/field_textinput.js b/core/field_textinput.js index 714643b14..bebc737db 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -253,6 +253,9 @@ Blockly.FieldTextInput.prototype.widgetDispose_ = function() { * @return {?string} A string representing a valid number, or null if invalid. */ Blockly.FieldTextInput.numberValidator = function(text) { + if(text === null) { + return null; + } // TODO: Handle cases like 'ten', '1.203,14', etc. // 'O' is sometimes mistaken for '0' by inexperienced users. text = text.replace(/O/ig, '0');