mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
skip over nullptr from map()
This commit is contained in:
@@ -234,9 +234,12 @@ namespace ifcopenshell { namespace geometry {
|
|||||||
std::transform(products.begin(), products.end(), std::back_inserter(items), [this, &placements](IfcUtil::IfcBaseClass* p) {
|
std::transform(products.begin(), products.end(), std::back_inserter(items), [this, &placements](IfcUtil::IfcBaseClass* p) {
|
||||||
auto item = converter_->mapping()->map(p);
|
auto item = converter_->mapping()->map(p);
|
||||||
// Product placements do not affect item reuse and should temporarily be swapped to identity
|
// Product placements do not affect item reuse and should temporarily be swapped to identity
|
||||||
std::swap(placements[item], ((taxonomy::geom_item*)item)->matrix);
|
if (item) {
|
||||||
|
std::swap(placements[item], ((taxonomy::geom_item*)item)->matrix);
|
||||||
|
}
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
items.erase(std::remove(items.begin(), items.end(), nullptr), items.end());
|
||||||
std::sort(items.begin(), items.end(), taxonomy::less);
|
std::sort(items.begin(), items.end(), taxonomy::less);
|
||||||
auto it = items.begin();
|
auto it = items.begin();
|
||||||
while (it < items.end()) {
|
while (it < items.end()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user