Avoid dereferencing iterators over empty indexed data values
It seems the values can be empty even if size of blocks is non-zero (e.g. blocks.size()==1)
This commit is contained in:
parent
a3f1c2afb0
commit
58fbda0483
@ -331,6 +331,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