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:
commit
18a0f6c1f8
@ -329,6 +329,9 @@ template <typename GroupBlockPolicy, storage::Ownership Ownership> struct Indexe
|
|||||||
// Return value at the given index
|
// Return value at the given index
|
||||||
ResultType at(std::uint32_t index) const
|
ResultType at(std::uint32_t index) const
|
||||||
{
|
{
|
||||||
|
if (values.empty())
|
||||||
|
return ResultType();
|
||||||
|
|
||||||
// Get block external ad internal indices
|
// Get block external ad internal indices
|
||||||
const BlocksNumberType block_idx = index / (BLOCK_SIZE + 1);
|
const BlocksNumberType block_idx = index / (BLOCK_SIZE + 1);
|
||||||
const std::uint32_t internal_idx = index % (BLOCK_SIZE + 1);
|
const std::uint32_t internal_idx = index % (BLOCK_SIZE + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user