File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments