mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Fix segfault trying to create IfcSweptDiskSolid with invalid curve #5474
In my case it was IfcIndexedPolyCurve with just 1 vertex. Though kernel->convert does return a boolean value to indicate if conversion was successful, we never used it - so it failed silently leading to segfault later on. Now we also stop processing those polycurves during mapping stage but checking kernel->convert result still might be useful in some other cases.
This commit is contained in:
@@ -95,8 +95,10 @@ namespace {
|
||||
|
||||
OpenCascadeKernel::curve_creation_visitor_result_type operator()(const taxonomy::loop::ptr& l) {
|
||||
TopoDS_Wire wire;
|
||||
kernel->convert(l, wire);
|
||||
return result = wire;
|
||||
if (!kernel->convert(l, wire)) {
|
||||
throw std::runtime_error("Failed to convert loop to wire");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
OpenCascadeKernel::curve_creation_visitor_result_type operator()(const taxonomy::edge::ptr& e) {
|
||||
|
||||
Reference in New Issue
Block a user