It returns None if it encounters EmptyTree. Some on proper input and fails on non-valid input that is not EmptyTree.