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 (is_floor_plan_) {
if (storey_hlr.find(storey) == storey_hlr.end()) { if (storey) {
if (use_hlr_poly_) { if (storey_hlr.find(storey) == storey_hlr.end()) {
storey_hlr[storey] = new HLRBRep_PolyAlgo; if (use_hlr_poly_) {
} else { storey_hlr[storey] = new HLRBRep_PolyAlgo;
storey_hlr[storey] = new HLRBRep_Algo; } 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 { else {
hlr_writer vis(*compound_to_hlr); hlr_writer vis(*compound_to_hlr);