mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Check for nullptr before resolving inverses
This commit is contained in:
@@ -231,6 +231,9 @@ AttributeValue IfcUtil::IfcBaseEntity::get(const std::string& name) const
|
||||
}
|
||||
|
||||
aggregate_of_instance::ptr IfcUtil::IfcBaseEntity::get_inverse(const std::string& name) const {
|
||||
if (file_ == nullptr) {
|
||||
throw IfcParse::IfcException("Instance not added to file");
|
||||
}
|
||||
const std::vector<const IfcParse::inverse_attribute*> attrs = declaration().as_entity()->all_inverse_attributes();
|
||||
std::vector<const IfcParse::inverse_attribute*>::const_iterator iter = attrs.begin();
|
||||
for (; iter != attrs.end(); ++iter) {
|
||||
|
||||
Reference in New Issue
Block a user