layer.childLayers isn't always set

fix #1030 
var childLayers = layer.childLayers || [];
??