mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
fix: block creation successful with undefined messages (#7591)
closes #7589 Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com>
This commit is contained in:
@@ -1641,6 +1641,18 @@ export class Block implements IASTNodeLocation, IDeletable {
|
||||
);
|
||||
}
|
||||
|
||||
// Validate that each arg has a corresponding message
|
||||
let n = 0;
|
||||
while (json['args' + n]) {
|
||||
if (json['message' + n] === undefined) {
|
||||
throw Error(
|
||||
warningPrefix +
|
||||
`args${n} must have a corresponding message (message${n}).`,
|
||||
);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
// Set basic properties of block.
|
||||
// Makes styles backward compatible with old way of defining hat style.
|
||||
if (json['style'] && json['style'].hat) {
|
||||
|
||||
Reference in New Issue
Block a user