From 421daa3d19b8cfba599064c330538b6ad2bc0114 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 30 Dec 2018 12:55:17 +0100 Subject: [PATCH] Work-around for invalid IfcOrganization instances --- src/ifcgeom/IfcGeomFunctions.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index e7698fabdd..10c3e533d7 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -1639,7 +1639,12 @@ IfcGeom::BRepElement* IfcGeom::Kernel::create_brep_for_representation_and if (rel->as()) { auto pdef = rel->as()->RelatingPropertyDefinition(); if (pdef->as()) { - if (pdef->as()->OwnerHistory()->OwningApplication()->ApplicationDeveloper()->Name() == "IfcOpenShell") { + std::string organization_name; + try { + // A couple of files are not according to the schema here. + organization_name = pdef->as()->OwnerHistory()->OwningApplication()->ApplicationDeveloper()->Name(); + } catch (...) {} + if (organization_name == "IfcOpenShell") { auto qs = pdef->as()->Quantities(); for (auto& q : *qs) { if (q->as() && q->Name() == "Total Surface Area") {