Skip to content

Commit

Permalink
STCC-212/STCC-213 Exception when accessing user lists (Catrobat#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregbauer authored and YoloSwagBoy committed Mar 20, 2020
1 parent bc8bef4 commit f58cc21
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/scratchtocatrobat/converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,11 @@ def _add_global_user_lists_to(self, catrobat_scene):
if self.scratch_project.global_user_lists is None:
return

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

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

for scratch_variable in scratch_object.get_variables():
Expand Down

0 comments on commit f58cc21

Please # to comment.