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

LayerList add sublayer none check (#22135)

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