diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 48574b8049..88688cbf01 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -1147,10 +1147,11 @@ std::string IfcEntityInstanceData::toString(bool upper) const { ss << ","; } if (attributes_[i] == 0) { - if (type_->as_entity()->derived()[i]) + if (type_->as_entity() != nullptr && type_->as_entity()->derived()[i]) { ss << "*"; - else + } else { ss << "$"; + } } else { ss << attributes_[i]->toString(upper); }