Guard against RangeError in findPeerInvalid