Skip to content

Commit 1852482

Browse files
gregbauerYoloSwagBoy
authored andcommitted
STCC-212/STCC-213 Exception when accessing user lists (Catrobat#145)
1 parent 18f7f08 commit 1852482

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/scratchtocatrobat/converter/converter.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,11 @@ def _add_global_user_lists_to(self, catrobat_scene):
657657
if self.scratch_project.global_user_lists is None:
658658
return
659659

660-
for global_user_list in self.scratch_project.global_user_lists:
660+
for global_user_list_data in self.scratch_project.global_user_lists:
661661
# TODO: use "visible" as soon as show/hide-formula-list-bricks are available in Catrobat => global_formula_list["visible"]
662662
# TODO: use "isPersistent" as soon as Catrobat supports this => global_formula_list["isPersistent"]
663-
catrobat_scene.project.userLists.add(global_user_list["listName"])
663+
global_user_list = catformula.UserList(global_user_list_data["listName"])
664+
catrobat_scene.project.userLists.add(global_user_list)
664665

665666
def _add_converted_sprites_to(self, catrobat_scene):
666667
for scratch_object in self.scratch_project.objects:
@@ -1050,7 +1051,8 @@ def _catrobat_sprite_from(self, scratch_object):
10501051
if not scratch_object.is_stage() and scratch_object.get_lists() is not None:
10511052
for user_list_data in scratch_object.get_lists():
10521053
assert len(user_list_data["listName"]) > 0
1053-
sprite.userLists.add(user_list_data["listName"])
1054+
user_list = catformula.UserList(user_list_data["listName"])
1055+
sprite.userLists.add(user_list)
10541056
# TODO: check if user list has been added...
10551057

10561058
for scratch_variable in scratch_object.get_variables():

0 commit comments

Comments
 (0)