Skip to content

Commit 58fbda0

Browse files
committed
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)
1 parent a3f1c2a commit 58fbda0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/util/indexed_data.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ template <typename GroupBlockPolicy, storage::Ownership Ownership> struct Indexe
331331
// Return value at the given index
332332
ResultType at(std::uint32_t index) const
333333
{
334+
if (values.empty())
335+
return ResultType();
336+
334337
// Get block external ad internal indices
335338
const BlocksNumberType block_idx = index / (BLOCK_SIZE + 1);
336339
const std::uint32_t internal_idx = index % (BLOCK_SIZE + 1);

0 commit comments

Comments
 (0)