Deal with sprites that don't have sound/costumes
This commit is contained in:
parent
bb68e9a85e
commit
5e7c9f1192
1 changed files with 8 additions and 2 deletions
|
@ -55,11 +55,17 @@ class Sprite(ScratchObj):
|
|||
|
||||
@property
|
||||
def costumes(self):
|
||||
return [ScratchMediaObj(x) for x in self._d['costumes']]
|
||||
try:
|
||||
return [ScratchMediaObj(x) for x in self._d['costumes']]
|
||||
except KeyError:
|
||||
return []
|
||||
|
||||
@property
|
||||
def sounds(self):
|
||||
return [ScratchMediaObj(x) for x in self._d['sounds']]
|
||||
try:
|
||||
return [ScratchMediaObj(x) for x in self._d['sounds']]
|
||||
except KeyError:
|
||||
return []
|
||||
|
||||
@property
|
||||
def assets(self):
|
||||
|
|
Reference in a new issue