Sfoglia il codice sorgente

@ error
Cause a TypeError when arg is UNSET

copycd 1 anno fa
parent
commit
b571501559
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      code/AssetLib/IFC/IFCReaderGen1_2x3.cpp

+ 4 - 0
code/AssetLib/IFC/IFCReaderGen1_2x3.cpp

@@ -2725,6 +2725,10 @@ template <> size_t GenericFill<IfcSpatialStructureElement>(const DB& db, const L
     do { // convert the 'CompositionType' argument
         std::shared_ptr<const DataType> arg = params[base++];
         if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::Schema_2x3::IfcSpatialStructureElement,2>::aux_is_derived[1]=true; break; }
+        if (dynamic_cast<const UNSET *>(&*arg)) {
+            // Consider assigning the default value as in->CompositionType = "ELEMENT".
+            break;
+        }
         try { GenericConvert( in->CompositionType, arg, db ); break; }
         catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); }
     } while (false);