Iterator: Don't crash on calling get() before initialize()

This commit is contained in:
Thomas Krijnen
2024-09-11 11:18:09 +02:00
parent 5fe85e71bb
commit c63f1cfa88
+4
View File
@@ -701,6 +701,10 @@ namespace IfcGeom {
/// Gets the representation of the current geometrical entity.
Element* get()
{
if (!initialization_outcome_) {
throw std::runtime_error("Iterator not initialized");
}
auto ret = *task_result_iterator_;
// If we want to organize the element considering their hierarchy