Fix illegal connections in stacks after a healing delete (issue 15).

This commit is contained in:
Neil Fraser
2014-11-21 14:57:30 -08:00
parent 6e14380fd2
commit 7cac5febca
3 changed files with 128 additions and 123 deletions

View File

@@ -427,7 +427,7 @@ Blockly.Block.prototype.unplug = function(healStack, bump) {
// Disconnect the next statement.
var nextTarget = this.nextConnection.targetConnection;
nextBlock.setParent(null);
if (previousTarget) {
if (previousTarget && previousTarget.checkType_(nextTarget)) {
// Attach the next statement to the previous statement.
previousTarget.connect(nextTarget);
}