Author: eallen
Date: 2008-10-29 16:20:00 -0400 (Wed, 29 Oct 2008)
New Revision: 2696
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Avoid possible exception
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-29 20:19:07 UTC (rev 2695)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-29 20:20:00 UTC (rev 2696)
@@ -114,9 +114,9 @@
obj = self.get_object(session)
cls = self.app.model.get_class_by_object(obj)
+ if cls:
+ return fmt_shorten(cls.get_object_title(session, obj), 16, 4)
- return fmt_shorten(cls.get_object_title(session, obj), 16, 4)
-
class CuminView(Widget):
def __init__(self, app, name):
super(CuminView, self).__init__(app, name)