提交 d0406193 编写于 作者: S songyouwei 提交者: hong

LayerList add sublayer none check (#22135)

test=develop
上级 0c2fff44
...@@ -201,8 +201,9 @@ class LayerList(Layer): ...@@ -201,8 +201,9 @@ class LayerList(Layer):
def __init__(self, sublayers=None): def __init__(self, sublayers=None):
super(LayerList, self).__init__() super(LayerList, self).__init__()
for idx, layer in enumerate(sublayers): if sublayers is not None:
self.add_sublayer(str(idx), layer) for idx, layer in enumerate(sublayers):
self.add_sublayer(str(idx), layer)
def __getitem__(self, idx): def __getitem__(self, idx):
if isinstance(idx, slice): if isinstance(idx, slice):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册