#952 bugfix, layer.children could come null