Properly test for the optional IfcGeometricRepresentationContext.ContextType being null in IfcGeomIterator.h

This commit is contained in:
Thomas Krijnen
2015-01-22 10:38:35 +00:00
parent 6c7c88d7a5
commit e1edda588e
+3 -1
View File
@@ -153,14 +153,16 @@ namespace IfcGeom {
// by the parent's context inverse attributes. // by the parent's context inverse attributes.
continue; continue;
} }
if (context->hasContextType()) {
std::string context_type_lc = context->ContextType(); std::string context_type_lc = context->ContextType();
for (std::string::iterator c = context_type_lc.begin(); c != context_type_lc.end(); ++c) { for (std::string::iterator c = context_type_lc.begin(); c != context_type_lc.end(); ++c) {
*c = tolower(*c); *c = tolower(*c);
} }
if (context->hasContextType() && context_types.find(context_type_lc) != context_types.end()) { if (context_types.find(context_type_lc) != context_types.end()) {
filtered_contexts->push(context); filtered_contexts->push(context);
} }
} }
}
if (filtered_contexts->size() == 0) { if (filtered_contexts->size() == 0) {
filtered_contexts = contexts; filtered_contexts = contexts;