File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -981,12 +981,14 @@ IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) {
981981
982982 // Obtain all forward references by a depth-first
983983 // traversal and add them to the file.
984- { IfcEntityList::ptr entity_attributes = traverse (entity, 1 );
985- for (IfcEntityList::it it = entity_attributes->begin (); it != entity_attributes->end (); ++it) {
986- if (*it != entity) {
987- entity_file_map.insert (entity_entity_map_t::value_type (*it, addEntity (*it)));
984+ try {
985+ IfcEntityList::ptr entity_attributes = traverse (entity, 1 );
986+ for (IfcEntityList::it it = entity_attributes->begin (); it != entity_attributes->end (); ++it) {
987+ if (*it != entity) {
988+ entity_file_map.insert (entity_entity_map_t::value_type (*it, addEntity (*it)));
989+ }
988990 }
989- } }
991+ } catch (...) { }
990992
991993 // See whether the instance is already part of a file
992994 if (entity->entity ->file != 0 ) {
@@ -1109,7 +1111,10 @@ IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) {
11091111 byid[new_id] = entity;
11101112
11111113 // The mapping by reference is updated.
1112- IfcEntityList::ptr entity_attributes = traverse (entity, 1 );
1114+ IfcEntityList::ptr entity_attributes (new IfcEntityList);
1115+ try {
1116+ entity_attributes = traverse (entity, 1 );
1117+ } catch (...) {}
11131118 for (IfcEntityList::it it = entity_attributes->begin (); it != entity_attributes->end (); ++it) {
11141119 IfcUtil::IfcBaseClass* entity_attribute = *it;
11151120 try {
You can’t perform that action at this time.
0 commit comments