Merge pull request #5891 from mloskot/ml/check-indexed-data-for-empty-values

Avoid dereferencing iterators over empty indexed data values
This commit is contained in:
Denis Chapligin
2020-12-01 15:26:58 +02:00
committed by GitHub
+3
View File
@@ -329,6 +329,9 @@ template <typename GroupBlockPolicy, storage::Ownership Ownership> struct Indexe
// Return value at the given index
ResultType at(std::uint32_t index) const
{
if (values.empty())
return ResultType();
// Get block external ad internal indices
const BlocksNumberType block_idx = index / (BLOCK_SIZE + 1);
const std::uint32_t internal_idx = index % (BLOCK_SIZE + 1);