layer.childLayers isn't always set

fix #1030