[Erp5-report] r36898 aurel - /erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jul 6 16:58:03 CEST 2010


Author: aurel
Date: Tue Jul  6 16:58:03 2010
New Revision: 36898

URL: http://svn.erp5.org?rev=36898&view=rev
Log:
manage case where xml_string return is None

Modified:
    erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py

Modified: erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py?rev=36898&r1=36897&r2=36898&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py [utf8] (original)
+++ erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py [utf8] Tue Jul  6 16:58:03 2010
@@ -762,7 +762,7 @@ class XMLSyncUtilsMixin(SyncCode):
           gid = subscriber.getGidFromObject(object)
           signature = Signature(id=gid, object=object).__of__(subscriber)
           signature.setTempXML(xml_string)
-          if xml_string.count('\n') > self.MAX_LINES:
+          if xml_string and xml_string.count('\n') > self.MAX_LINES:
             more_data = True
             xml_string, rest_string = self.cutXML(xml_string)
             signature.setPartialXML(rest_string)
@@ -770,7 +770,9 @@ class XMLSyncUtilsMixin(SyncCode):
             signature.setAction('Add')
           #in first, we try with rid if there is one
           gid = signature.getRid() or signature.getGid()
-          syncml_data_list.append(self.addXMLObject(
+          # XML method might returns None value
+          if xml_string:
+            syncml_data_list.append(self.addXMLObject(
                                   cmd_id=cmd_id,
                                   object=object,
                                   gid=gid,




More information about the Erp5-report mailing list