ardublockly
ardublockly copied to clipboard
undefined type forgotten in types.js
First thanks a lot for your wonderful type script !!! I used it in Blockly@rduino and it works fine. But in 'types.js', line 168 I added a code for testing if nextblock.connection is null
Blockly.Types.getChildBlockType = function(block) {
var blockType = null;
var nextBlock = block;
// Only checks first input block, so it decides the type. Incoherences amongst
// multiple inputs dealt at a per-block level with their own block warnings
while (nextBlock && (nextBlock.getBlockType === undefined) &&
(nextBlock.inputList.length > 0) && (nextBlock.inputList[0].connection != null)) {
nextBlock = nextBlock.inputList[0].connection.targetBlock();
}
I d'ont know if you prefer...
Thanks a lot for the additional check! I will be unavailable for a few weeks from tomorrow and wouldn't want to rush it, but I'll definitely have a proper look at this one once I'm back.