latst_trinfo : do not crash on absent wf history stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 21 Oct 2009 11:19:54 +0200
branchstable
changeset 3765 769dc0107f31
parent 3764 034aa14b740a
child 3766 9e5dc4b1ada4
latst_trinfo : do not crash on absent wf history
entities/wfobjs.py
--- a/entities/wfobjs.py	Wed Oct 21 09:47:55 2009 +0200
+++ b/entities/wfobjs.py	Wed Oct 21 11:19:54 2009 +0200
@@ -411,7 +411,10 @@
 
     def latest_trinfo(self):
         """return the latest transition information for this entity"""
-        return self.reverse_wf_info_for[-1]
+        try:
+            return self.reverse_wf_info_for[-1]
+        except IndexError:
+            return None
 
     @cached
     def cwetype_workflow(self):