diff --git a/include/util/indexed_data.hpp b/include/util/indexed_data.hpp index f52011474..475c68a96 100644 --- a/include/util/indexed_data.hpp +++ b/include/util/indexed_data.hpp @@ -329,6 +329,9 @@ template 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);