Skip to content

Commit 53d09fc

Browse files
authored
m
1 parent 3bcbee4 commit 53d09fc

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

blocks_vertical/procedures.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -891,18 +891,19 @@ Blockly.ScratchBlocks.ProcedureUtils.removeFieldCallback = function(field) {
891891
return;
892892
}
893893
var inputNameToRemove = null;
894+
const cannotRemove = (i) => i == 0 && this.inputList[1].type == Blockly.NEXT_STATEMENT
894895
for (var n = 0; n < this.inputList.length; n++) {
895896
var input = this.inputList[n];
896897
if (input.connection) {
897-
var target = input.connection.targetBlock();
898+
var target = input.connection.tak();
898899
if (target.getField(field.name) == field) {
900+
if (cannotRemove(n)) return
899901
inputNameToRemove = input.name;
900902
}
901903
} else {
902-
for (var j = 0; j < input.fieldRow.length; j++) {
903-
if (input.fieldRow[j] == field) {
904-
inputNameToRemove = input.name;
905-
}
904+
if (input.fieldRow[0] == field) {
905+
if (cannotRemove(n)) return
906+
inputNameToRemove = input.name;
906907
}
907908
}
908909
}

0 commit comments

Comments
 (0)