[ldapfeed] don't crash if entity is None. Closes (superficialy) #2341266
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 03 May 2012 15:45:58 +0200
changeset 8382 76c7149d9076
parent 8381 a682f5cb73f6
child 8383 3f34d69e0c22
[ldapfeed] don't crash if entity is None. Closes (superficialy) #2341266
sobjects/ldapparser.py
--- a/sobjects/ldapparser.py	Wed May 02 10:13:39 2012 +0200
+++ b/sobjects/ldapparser.py	Thu May 03 15:45:58 2012 +0200
@@ -43,7 +43,7 @@
         for userdict in source._search(self._cw, source.user_base_dn,
                                        source.user_base_scope, searchstr):
             entity = self.extid2entity(userdict['dn'], 'CWUser', **userdict)
-            if not self.created_during_pull(entity):
+            if entity is not None and not self.created_during_pull(entity):
                 self.notify_updated(entity)
                 attrs = self.ldap2cwattrs(userdict)
                 self.update_if_necessary(entity, attrs)