Skip to content

Commit 18a0f6c

Browse files
authored
Merge pull request #5891 from mloskot/ml/check-indexed-data-for-empty-values
Avoid dereferencing iterators over empty indexed data values
2 parents 50d9632 + 58fbda0 commit 18a0f6c

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
@@ -329,6 +329,9 @@ template <typename GroupBlockPolicy, storage::Ownership Ownership> struct Indexe
329329
// Return value at the given index
330330
ResultType at(std::uint32_t index) const
331331
{
332+
if (values.empty())
333+
return ResultType();
334+
332335
// Get block external ad internal indices
333336
const BlocksNumberType block_idx = index / (BLOCK_SIZE + 1);
334337
const std::uint32_t internal_idx = index % (BLOCK_SIZE + 1);

0 commit comments

Comments
 (0)