We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 828cee8 commit 5f3f6acCopy full SHA for 5f3f6ac
1 file changed
src/Iteration.cpp
@@ -61,7 +61,12 @@ Iteration::Iteration() : Attributable(NoInit())
61
62
uint64_t Iteration::getCachedIterationIndex() const
63
{
64
- return *get().m_iterationIndex;
+ auto idx = get().m_iterationIndex;
65
+ if (!idx.has_value())
66
+ {
67
+ throw error::Internal("Iteration index not known.");
68
+ }
69
+ return *idx;
70
}
71
72
template <typename T>
0 commit comments