diff --git a/src/ifcgeom/IfcGeomIteratorImplementation.h b/src/ifcgeom/IfcGeomIteratorImplementation.h index dec994b583..cfa5d5d42a 100644 --- a/src/ifcgeom/IfcGeomIteratorImplementation.h +++ b/src/ifcgeom/IfcGeomIteratorImplementation.h @@ -388,18 +388,24 @@ namespace IfcGeom { void collect() { int i = 0; IfcSchema::IfcProduct::list* previous = nullptr; - while (auto rp = get_next_task()) { + while (auto rp = try_get_next_task()) { // Note that get_next_task() mutates the state of the iterator // we use that capture all products that can be processed as // part of this representation and then keep iterating until // the underlying list of products changes. if (ifcproducts.get() != previous) { previous = ifcproducts.get(); - geometry_conversion_task
t; - t.index = i++; - t.representation = *representation_iterator; - t.products = ifcproducts; - tasks_.emplace_back(t); + if (ifcproducts->size()) { + geometry_conversion_task
t;
+ t.index = i++;
+ t.representation = *representation_iterator;
+ t.products = ifcproducts;
+ tasks_.emplace_back(t);
+ }
+ }
+
+ if (rp->which() == 1) {
+ Logger::Error(boost::get