]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Check if aUnitName is NULL before testing unit value.
authorgdd <gdd>
Thu, 9 Aug 2012 14:30:34 +0000 (14:30 +0000)
committergdd <gdd>
Thu, 9 Aug 2012 14:30:34 +0000 (14:30 +0000)
src/IGESImport/IGESImport.cxx

index cff70de1861e89bc3e0b2a54a8aef281a94fab2d..43f0e38706e165903e68d87d8d26ccf97edf8de9 100644 (file)
@@ -101,14 +101,18 @@ IGESIMPORT_EXPORT
           if (!aModel.IsNull()) {
             Handle(TCollection_HAsciiString) aUnitName =
               aModel->GlobalSection().UnitName();
-            //cout<<"aUnitName = "<<aUnitName->ToCString()<<endl;
-            //cout<<"aUnitFlag = "<<aModel->GlobalSection().UnitFlag()<<endl;
-            if (aUnitName->String()=="MM") {
-              P = gp_Pnt(0.001,0.0,0.0);
-            }
-            else if (aUnitName->String()=="CM") {
-              P = gp_Pnt(0.01,0.0,0.0);
+            if (!aUnitName.IsNull()) {
+              //cout<<"aUnitName = "<<aUnitName->ToCString()<<endl;
+              //cout<<"aUnitFlag = "<<aModel->GlobalSection().UnitFlag()<<endl;
+              if (aUnitName->String()=="MM") {
+                P = gp_Pnt(0.001,0.0,0.0);
+              }
+              else if (aUnitName->String()=="CM") {
+                P = gp_Pnt(0.01,0.0,0.0);
+              }
             }
+            //else
+            //  cout << "aUnitName is NULL !!" << endl;
           }
           BRep_Builder B;
           TopoDS_Vertex V;