Fix buffer check function when there are no endpoints