Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-11-11 21:13:02 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-11-11 21:13:02 (GMT)
commit1b4590d79c46385e06ca5d9e4a60fb20ac4c56a1 (patch)
tree46fec558085ab50f1fe8425659609e3714e1d04e /TurtleArt
parent0d2af596ffb7d429567dcfeabc828086ce920467 (diff)
bounds check needed when block definitions are missing
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/tawindow.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index eaaed3a..03bfe1c 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1353,8 +1353,8 @@ class TurtleArtWindow():
newblk.connections[i + 1] = argblk
self.drag_group = find_group(newblk)
self.block_operation = 'new'
- if newblk.spr.labels[0] is not None and \
- newblk.name not in ['', 'number', 'string']:
+ if len(newblk.spr.labels) > 0 and newblk.spr.labels[0] is not None \
+ and newblk.name not in ['', 'number', 'string']:
if newblk.spr.labels[0] not in self.used_block_list:
if len(self.used_block_list) > 0:
self.used_block_list.append(', ')
@@ -2833,7 +2833,7 @@ class TurtleArtWindow():
blk.spr.set_layer(BLOCK_LAYER)
if check_dock:
blk.connections = 'check'
- if self.running_sugar and blk.spr.labels[0] is not None and \
+ if self.running_sugar and len(blk.spr.labels) > 0 and \
blk.name not in ['', ' ', 'number', 'string']:
if blk.spr.labels[0] not in self.used_block_list:
if len(self.used_block_list) > 0: