Fail safely when the location is out of bounds when checking pairs.