]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/runtime/XMLCORBAConv.cxx
Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / runtime / XMLCORBAConv.cxx
index 608d8d66e017d0d0aac3976662884a8140fe242c..1d41720b6a41d43e595f206878ffc0504a6f53a5 100644 (file)
@@ -2,6 +2,8 @@
 #include "TypeConversions.hxx"
 #include "XMLCORBAConv.hxx"
 #include "CORBAXMLConv.hxx"
+#include "CORBAPorts.hxx"
+#include "TypeCode.hxx"
 
 #include <libxml/parser.h>
 #include <iostream>
@@ -33,7 +35,7 @@ void XmlCorba::put(const char *data) throw(ConversionException)
   DEBTRACE(data);
   xmlDocPtr doc;
   xmlNodePtr cur;
-  CORBA::Any *a;
+  CORBA::Any *a=NULL;
   
   doc = xmlParseMemory(data, strlen(data));
   if (doc == NULL ) 
@@ -76,6 +78,14 @@ void XmlCorba::put(const char *data) throw(ConversionException)
       cur = cur->next;
     }
   xmlFreeDoc(doc);
+  if(a==NULL)
+    {
+      stringstream msg;
+      msg << "Problem in conversion: incorrect XML value";
+      msg << " (" << __FILE__ << ":" << __LINE__ << ")";
+      throw ConversionException(msg.str());
+    }
+
   //xmlCleanupParser();
   _port->put(a);
   _port->setStringRef(data);