mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Keep file_ as nullptr to not bypass addEntity() #7264
This commit is contained in:
@@ -748,7 +748,7 @@ std::optional<std::tuple<size_t, const IfcParse::declaration*, IfcEntityInstance
|
|||||||
IfcUtil::IfcBaseClass* IfcParse::impl::rocks_db_file_storage::create(const IfcParse::declaration* decl) {
|
IfcUtil::IfcBaseClass* IfcParse::impl::rocks_db_file_storage::create(const IfcParse::declaration* decl) {
|
||||||
if (decl->as_entity() || decl->as_type_declaration()) {
|
if (decl->as_entity() || decl->as_type_declaration()) {
|
||||||
auto* inst = file->schema()->instantiate(decl, rocks_db_attribute_storage{});
|
auto* inst = file->schema()->instantiate(decl, rocks_db_attribute_storage{});
|
||||||
inst->file_ = file;
|
inst->file_ = nullptr;
|
||||||
return file->addEntity(inst);
|
return file->addEntity(inst);
|
||||||
} else {
|
} else {
|
||||||
throw std::runtime_error("Requires and entity or type declaration");
|
throw std::runtime_error("Requires and entity or type declaration");
|
||||||
@@ -764,6 +764,6 @@ IfcUtil::IfcBaseClass* IfcParse::impl::in_memory_file_storage::create(const IfcP
|
|||||||
} else {
|
} else {
|
||||||
throw std::runtime_error("Requires and entity or type declaration");
|
throw std::runtime_error("Requires and entity or type declaration");
|
||||||
}
|
}
|
||||||
inst->file_ = file;
|
inst->file_ = nullptr;
|
||||||
return file->addEntity(inst);
|
return file->addEntity(inst);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user