Safeguard against runtime error when invoking HLR without storey containment

This commit is contained in:
Thomas Krijnen
2022-02-27 20:57:05 +01:00
parent b5133c6874
commit 96902bf38a
+12 -8
View File
@@ -1155,16 +1155,20 @@ void SvgSerializer::write(const geometry_data& data) {
}
}
if (is_floor_plan_ && storey) {
if (storey_hlr.find(storey) == storey_hlr.end()) {
if (use_hlr_poly_) {
storey_hlr[storey] = new HLRBRep_PolyAlgo;
} else {
storey_hlr[storey] = new HLRBRep_Algo;
if (is_floor_plan_) {
if (storey) {
if (storey_hlr.find(storey) == storey_hlr.end()) {
if (use_hlr_poly_) {
storey_hlr[storey] = new HLRBRep_PolyAlgo;
} else {
storey_hlr[storey] = new HLRBRep_Algo;
}
}
hlr_writer vis(*compound_to_hlr);
boost::apply_visitor(vis, storey_hlr[storey]);
} else {
Logger::Warning("Unable to invoke HLR due to absence of storey containment", data.product);
}
hlr_writer vis(*compound_to_hlr);
boost::apply_visitor(vis, storey_hlr[storey]);
}
else {
hlr_writer vis(*compound_to_hlr);