Do not show an error if the node have no children

In case of custorm lazyLoad, if the node have no children, and if the node is activated, Javascript show an error because the length can not be found on an undefined object.
This prevent javascript to fire this error.