Initialize additionalVars in case it isn't provided. This is necessary for the vertical playground for example.

This commit is contained in:
Karishma Chadha 2018-07-06 13:03:36 -04:00
parent 83af7c0c18
commit 768b5e1b09

View file

@ -291,6 +291,7 @@ Blockly.Variables.createVariable = function(workspace, opt_callback, opt_type) {
Blockly.prompt(newMsg, '',
function(text, scope, additionalVars) {
var isLocal = (scope === 'local') || false;
additionalVars = additionalVars || [];
var validatedText = validate(text, workspace, additionalVars, opt_callback);
if (validatedText) {
// The name is valid according to the type, create the variable