From dbf9f213fdc21a8d5db9685918812b795e771a1b Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 4 Apr 2018 14:40:10 +0200 Subject: [PATCH] Dont fail on adding length measure instances to empty files --- src/ifcparse/IfcParse.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 831bbef2ef..ebbc6ca6d2 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -1605,7 +1605,6 @@ IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) { if (boost::math::isnan(conversion_factor)) { const std::pair this_file_unit = getUnit("LENGTHUNIT"); const std::pair other_file_unit = other_file->getUnit("LENGTHUNIT"); - std::cerr << other_file_unit.second << " " << this_file_unit.second << std::endl; if (this_file_unit.first && other_file_unit.first) { conversion_factor = other_file_unit.second / this_file_unit.second; } else { @@ -2027,7 +2026,7 @@ std::pair IfcFile::getUnit(const std::string& un std::pair return_value(0, 1.); IfcEntityList::ptr projects = instances_by_type(schema()->declaration_by_name("IfcProject")); - if (projects->size() == 1) { + if (projects && projects->size() == 1) { IfcUtil::IfcBaseClass* project = *projects->begin(); IfcUtil::IfcBaseClass* unit_assignment = *project->data().getArgument(