DataModel Objects are now deleted. Check we are not asking for a deleted one. 80/9080/2
Bruno JOFRET [Thu, 20 Sep 2012 09:07:45 +0000 (11:07 +0200)]
Change-Id: I2d9362428b221703f9a7bb4900ca8a387d7b13d9

scilab/modules/graphic_objects/src/cpp/dataModel.cpp

index 7169be1..8346d5c 100644 (file)
@@ -27,9 +27,18 @@ BOOL DataModel::setGraphicObjectProperty(char const* _pstID, int _iName, void co
     int returnValue = 0;
 
     dataObject = (*m_dataMap)[std::string(_pstID)];
+    if (dataObject == NULL)
+    {
+        return FALSE;
+    }
 
     property = dataObject->getPropertyFromName(_iName);
 
+    if (property == UNKNOWN_DATA_PROPERTY)
+    {
+        return FALSE;
+    }
+
     returnValue = dataObject->setDataProperty(property, _dblValue, numElements);
 
     return (BOOL) returnValue;