From c63f1cfa88b5b00836c5c8b002aae63257850958 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 11 Sep 2024 11:18:09 +0200 Subject: [PATCH] Iterator: Don't crash on calling get() before initialize() --- src/ifcgeom/Iterator.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ifcgeom/Iterator.h b/src/ifcgeom/Iterator.h index 8bf862def1..242cdb7418 100644 --- a/src/ifcgeom/Iterator.h +++ b/src/ifcgeom/Iterator.h @@ -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