]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Protection from exception. Additional verification added in setTitle method (NPAL15945)
authorsln <sln@opencascade.com>
Thu, 24 May 2007 09:12:43 +0000 (09:12 +0000)
committersln <sln@opencascade.com>
Thu, 24 May 2007 09:12:43 +0000 (09:12 +0000)
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc

index 309473f11ab124f00bfcf67aa93ca3a4597eb0ff..acc98b043575b88d8ef7286babe520d0213d98e2 100644 (file)
@@ -302,8 +302,13 @@ VISU::ColoredPrs3d_i
 {
   // mkr : IPAL14030
   std::strstream aStream;
+  if ( !myField )
+    return;
   const VISU::TValField& aValField = myField->myValField;
-  const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
+  VISU::TValField::const_iterator anIter = aValField.find(myIteration);
+  if ( anIter == aValField.end() )
+    return;
+  const VISU::PValForTime aValForTime = anIter->second;
   aStream<<theTitle<<" "<<VISU_Convertor::GenerateName(aValForTime->myTime)<<std::ends;
   std::string aScalarBarTitle = aStream.str();
   if(myTitle != theTitle || myScalarBarTitle != aScalarBarTitle){
index cd1484f256b4311b6ef047f065ad5677c67c8b7c..2b9f782f9eadd8c735430b5ad5e52819f6cd4d63 100644 (file)
@@ -184,7 +184,10 @@ void VISU::ScalarMapOnDeformedShape_i::SetTitle(const char* theTitle)
   if ( !myScalarField )
     return;
   const VISU::TValField& aValField = myScalarField->myValField;
-  const VISU::PValForTime aValForTime = aValField.find(myScalarIteration)->second;
+  VISU::TValField::const_iterator anIter = aValField.find(myScalarIteration);
+  if ( anIter == aValField.end() )
+    return;
+  const VISU::PValForTime aValForTime = anIter->second;
   if(aValForTime){
     aStream<<theTitle<<" "<<VISU_Convertor::GenerateName(aValForTime->myTime)<<std::ends;
     std::string aScalarBarTitle = aStream.str();