Skip to content

Commit 8428730

Browse files
author
Walter Bender
committed
don't instance null names onto boxes palette
1 parent db1e8e1 commit 8428730

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

js/blocks.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,13 @@ function Blocks(canvas, stage, refreshCanvas, trashcan, updateStage, getStageSca
23642364
};
23652365

23662366
this.newStoreinBlock = function (name) {
2367-
if ('myStorein_' + name in this.protoBlockDict) {
2367+
if (name == null) {
2368+
console.log('null name passed to newStoreinBlock');
2369+
return;
2370+
} else if (name == undefined) {
2371+
console.log('undefined name passed to newStoreinBlock');
2372+
return;
2373+
} else if ('myStorein_' + name in this.protoBlockDict) {
23682374
return;
23692375
}
23702376

@@ -2388,7 +2394,13 @@ function Blocks(canvas, stage, refreshCanvas, trashcan, updateStage, getStageSca
23882394
};
23892395

23902396
this.newNamedboxBlock = function (name) {
2391-
if ('myBox_' + name in this.protoBlockDict) {
2397+
if (name == null) {
2398+
console.log('null name passed to newNamedboxBlock');
2399+
return;
2400+
} else if (name == undefined) {
2401+
console.log('undefined name passed to newNamedboxBlock');
2402+
return;
2403+
} else if ('myBox_' + name in this.protoBlockDict) {
23922404
return;
23932405
}
23942406

0 commit comments

Comments
 (0)