0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / IGESData / IGESData_FreeFormatEntity.cxx
index 0a27c4c..f72bb42 100644 (file)
@@ -43,7 +43,11 @@ IGESData_FreeFormatEntity::IGESData_FreeFormatEntity ()    {  }
     Standard_Boolean  IGESData_FreeFormatEntity::ParamData
   (const Standard_Integer num, Interface_ParamType& ptype,
    Handle(IGESData_IGESEntity)& ent, Handle(TCollection_HAsciiString)& val) const 
-{  return UndefinedContent()->ParamData (num,ptype,ent,val);  }
+{
+  Handle(Standard_Transient) anEnt = ent;
+  return UndefinedContent()->ParamData (num, ptype, anEnt, val) &&
+         ! (ent = Handle(IGESData_IGESEntity)::DownCast (anEnt)).IsNull();
+}
 
 
     Interface_ParamType  IGESData_FreeFormatEntity::ParamType