Products.Archetypes/master: Merge remote-tracking branch 'origin/master' into vkarppinen

Valtteri Karppinen <jenkins-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: Products.Archetypes
Branch: refs/heads/master
Date: 2017-07-06T10:43:19+03:00
Author: Valtteri Karppinen (vkarppinen) <[email protected]>
Commit: https://github.com/plone/Products.Archetypes/commit/1a6f23444edc9af93406f121a227b9d0226b4624

Merge remote-tracking branch 'origin/master' into vkarppinen/textcount

Files changed:
M CHANGES.rst
M Products/Archetypes/ReferenceEngine.py

diff --git a/CHANGES.rst b/CHANGES.rst
index bbe93737..8d33c44e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -21,6 +21,10 @@ Bug fixes:
   by replacing maxlimit alert() with highlighting textcountfield.
   [vkarppinen]
 
+- Prevent AttributeError on deleting a Reference from a object that is gone.
+  Fixes https://github.com/plone/plone.app.contenttypes/issues/41
+  [pbauer]
+
 
 1.14.1 (2017-06-16)
 -------------------
diff --git a/Products/Archetypes/ReferenceEngine.py b/Products/Archetypes/ReferenceEngine.py
index 36003c05..36c9e8cd 100644
--- a/Products/Archetypes/ReferenceEngine.py
+++ b/Products/Archetypes/ReferenceEngine.py
@@ -555,6 +555,8 @@ def _getUUIDFor(self, object):
     def _deleteReference(self, referenceObject):
         try:
             sobj = referenceObject.getSourceObject()
+            if sobj is None:
+                return
             referenceObject.delHook(self, sobj,
                                     referenceObject.getTargetObject())
         except ReferenceException:



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.