From ba7eec2c0b707f13e0b4b6f10bfe7b0b94f6b031 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 26 Feb 2014 10:56:22 +0100 Subject: [PATCH] Fix for empty shape reps --- src/ifcgeom/IfcGeomFunctions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 204eb9fc69..f2ecc753a1 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -572,7 +572,7 @@ std::string IfcGeom::create_brep_data(Ifc2x3::IfcProduct* ifc_product) { Ifc2x3::IfcProductRepresentation* prod_rep = ifc_product->Representation(); Ifc2x3::IfcRepresentation::list li = prod_rep->Representations(); - Ifc2x3::IfcShapeRepresentation* shape_rep; + Ifc2x3::IfcShapeRepresentation* shape_rep = 0; for (Ifc2x3::IfcRepresentation::it i = li->begin(); i != li->end(); ++i) { const std::string representation_identifier = (*i)->RepresentationIdentifier(); if ((*i)->is(Ifc2x3::Type::IfcShapeRepresentation) && (representation_identifier == "Body" || representation_identifier == "Facetation")) { @@ -581,6 +581,8 @@ std::string IfcGeom::create_brep_data(Ifc2x3::IfcProduct* ifc_product) { } } + if (!shape_rep) return ""; + IfcGeom::IfcRepresentationShapeItems shapes; if (!IfcGeom::convert_shapes(shape_rep,shapes)) { return "";