diff --git a/src/common/quantile.h b/src/common/quantile.h index acaf0b225c15..07e573bfb206 100644 --- a/src/common/quantile.h +++ b/src/common/quantile.h @@ -720,6 +720,8 @@ class HostSketchContainer { static uint32_t SearchGroupIndFromRow(std::vector const &group_ptr, size_t const base_rowid) { + CHECK_LT(base_rowid, group_ptr.back()) + << "Row: " << base_rowid << " is not found in any group."; bst_group_t group_ind = std::upper_bound(group_ptr.cbegin(), group_ptr.cend() - 1, base_rowid) - group_ptr.cbegin() - 1;