Skip to content

Commit

Permalink
Merge pull request #110 from plone/fix_delete_reference
Browse files Browse the repository at this point in the history
Prevent AttributeError on deleting a Reference
  • Loading branch information
jensens authored Aug 5, 2018
2 parents fc150a7 + 7bc06f0 commit 7068c71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ New features:

Bug fixes:

- *add item here*

- Prevent AttributeError on deleting a Reference from a object that is
gone. Backport from master #91. Fixes plone/plone.app.contenttypes#41.
[fredvd, pbauer]

1.9.18 (2018-05-03)
-------------------
Expand Down
2 changes: 2 additions & 0 deletions Products/Archetypes/ReferenceEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,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:
Expand Down

0 comments on commit 7068c71

Please sign in to comment.