From 952719f19b3b2a3f1733d5db5d7a82a1f10448d9 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 5 Jul 2022 10:27:44 +0200 Subject: [PATCH] #2260 correct init order --- src/ifcwrap/IfcGeomWrapper.i | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index ebc76c9350..4f7f08ca9d 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -483,6 +483,15 @@ struct ShapeRTTI : public boost::static_visitor } } + if (!ifc_representation) { + if (reps->size()) { + // Return a random representation + ifc_representation = *reps->begin(); + } else { + throw IfcParse::IfcException("No suitable IfcRepresentation found"); + } + } + // Read precision for found representation's context auto context = ifc_representation->ContextOfItems(); if (context->template as()) { @@ -499,15 +508,6 @@ struct ShapeRTTI : public boost::static_visitor kernel.setValue(IfcGeom::Kernel::GV_PRECISION, p); } - if (!ifc_representation) { - if (reps->size()) { - // Return a random representation - ifc_representation = *reps->begin(); - } else { - throw IfcParse::IfcException("No suitable IfcRepresentation found"); - } - } - IfcGeom::BRepElement* brep = kernel.convert(settings, ifc_representation, product); if (!brep) { throw IfcParse::IfcException("Failed to process shape");