We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d745a6b commit edf96e7Copy full SHA for edf96e7
1 file changed
core/block.js
@@ -1020,7 +1020,8 @@ Blockly.Block.prototype.getFieldValue = function(name) {
1020
Blockly.Block.prototype.setFieldValue = function(newValue, name) {
1021
var field = this.getField(name);
1022
goog.asserts.assertObject(field, 'Field "%s" not found.', name);
1023
- field.setValue(newValue);
+ if (field) field.setValue(newValue);
1024
+ else console.warn(`Field '${name}' not found.`)
1025
};
1026
1027
/**
0 commit comments