checking if the FileObject has children before getting the children