schema nullptr dereference

This commit is contained in:
Thomas Krijnen
2026-07-30 03:34:46 +02:00
parent d472814e2a
commit 4b14c21963
+12 -10
View File
@@ -1944,17 +1944,19 @@ void ifcopenshell::instance_streamer<Reader>::initialize_header() {
storage_.schema = schema_; storage_.schema = schema_;
types_to_bypass_materialized_.resize(schema_->declarations().size(), false); if (schema_) {
for (auto& bp : types_to_bypass_) { types_to_bypass_materialized_.resize(schema_->declarations().size(), false);
std::function<void(const ifcopenshell::entity*)> mark; for (auto& bp : types_to_bypass_) {
mark = [&](const ifcopenshell::entity* e) { std::function<void(const ifcopenshell::entity*)> mark;
types_to_bypass_materialized_[e->index_in_schema()] = true; mark = [&](const ifcopenshell::entity* e) {
for (auto& subtype : e->subtypes()) { types_to_bypass_materialized_[e->index_in_schema()] = true;
mark(subtype); for (auto& subtype : e->subtypes()) {
mark(subtype);
}
};
if (auto* e = bp->as_entity()) {
mark(e);
} }
};
if (auto* e = bp->as_entity()) {
mark(e);
} }
} }
} }