mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Fix potential segfault in hierarchy helper
This commit is contained in:
@@ -522,6 +522,9 @@ IfcSchema::IfcGeometricRepresentationContext* IfcHierarchyHelper::getRepresentat
|
|||||||
if (it != contexts.end()) return it->second;
|
if (it != contexts.end()) return it->second;
|
||||||
else {
|
else {
|
||||||
IfcSchema::IfcProject* project = getSingle<IfcSchema::IfcProject>();
|
IfcSchema::IfcProject* project = getSingle<IfcSchema::IfcProject>();
|
||||||
|
if (!project) {
|
||||||
|
project = addProject();
|
||||||
|
}
|
||||||
IfcSchema::IfcRepresentationContext::list::ptr project_contexts = project->RepresentationContexts();
|
IfcSchema::IfcRepresentationContext::list::ptr project_contexts = project->RepresentationContexts();
|
||||||
IfcSchema::IfcGeometricRepresentationContext* context = new IfcSchema::IfcGeometricRepresentationContext(
|
IfcSchema::IfcGeometricRepresentationContext* context = new IfcSchema::IfcGeometricRepresentationContext(
|
||||||
boost::none, s, 3, 1e-5, addPlacement3d(), addDoublet<IfcSchema::IfcDirection>(0, 1));
|
boost::none, s, 3, 1e-5, addPlacement3d(), addDoublet<IfcSchema::IfcDirection>(0, 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user