Skip to content

Commit

Permalink
[STCC-189] skip blocks that have neither a parent nor a next block (#120
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Philipp Fleischhacker authored and AntiDog committed Apr 30, 2019
1 parent 4807635 commit 0fe27ba
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/scratchtocatrobat/scratch/scratch3.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ def parse_sprite(self, sprite):
return scratch2ProjectDict

def build_block_structure(self, blockId, temp_block_dict):
block = temp_block_dict[blockId]
if block.nextName is not None:
block.nextBlock = temp_block_dict[block.nextName]
if block.parentName is not None:
block.parentBlock = temp_block_dict[block.parentName]

try:
block = temp_block_dict[blockId]
if block.nextName is not None:
block.nextBlock = temp_block_dict[block.nextName]
if block.parentName is not None:
block.parentBlock = temp_block_dict[block.parentName]
except KeyError as ex:
log.warn("Block: " + ex.message + " does not exist in the block dictionary.")

0 comments on commit 0fe27ba

Please # to comment.