Account for a parent not being adaptable in ITreeBase.iterancestors()
authorDenis Laxalde <denis.laxalde@logilab.fr>
Fri, 26 Apr 2019 15:04:12 +0200
changeset 3001 587b718f1284
parent 3000 e9dd2397f4ef
child 3002 1fe87336af7c
Account for a parent not being adaptable in ITreeBase.iterancestors()
cubicweb_seda/entities/itree.py
--- a/cubicweb_seda/entities/itree.py	Wed Apr 24 17:49:29 2019 +0200
+++ b/cubicweb_seda/entities/itree.py	Fri Apr 26 15:04:12 2019 +0200
@@ -68,6 +68,8 @@
                     break
                 yield curr
                 curr = curr.cw_adapt_to('ITreeBase')
+                if curr is None:
+                    break
         return _uptoroot(self)
 
     iterparents = iterancestors  # Compat. with CubicWeb's ITree.