Skip to content

Commit c25cff6

Browse files
committed
Correct setting attributes on lazily loaded instances
1 parent 48a6121 commit c25cff6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/ifcparse/IfcParse.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,10 @@ Argument* IfcEntityInstanceData::getArgument(unsigned int i) const {
10081008
}
10091009

10101010
void IfcEntityInstanceData::setArgument(unsigned int i, Argument* a, IfcUtil::ArgumentType attr_type) {
1011+
if (!initialized_) {
1012+
load_();
1013+
}
1014+
10111015
while (attributes_.size() < i) {
10121016
attributes_.push_back(new NullArgument());
10131017
}

src/ifcparse/IfcSpfHeader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ HeaderEntity::HeaderEntity(const char * const datatype, IfcFile* file)
4141
if (file) {
4242
offset_in_file_ = file->stream->Tell();
4343
load_();
44+
} else {
45+
initialized_ = true;
4446
}
4547
}
4648

0 commit comments

Comments
 (0)