Commit 792ea553 authored by Nicolas Dumazet's avatar Nicolas Dumazet

do not crash if the object has no parent because it's unwrapped


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42324 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b21c881d
......@@ -3883,7 +3883,11 @@ class Base( CopyContainer,
self._p_changed = True
# this might look useless, but it is necessary to explicitely record
# the change in the parent container, because the class has changed
setattr(self.getParentValue(), self.getId(), self)
try:
parent = self.getParentValue()
except AttributeError:
return
setattr(parent, self.getId(), self)
security.declareProtected(Permissions.DeletePortalContent,
'migratePortalType')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment