common/mixins.py
changeset 441 49e4717e2371
parent 361 5cd8bc047b52
child 471 9dc392f05c65
--- a/common/mixins.py	Mon Jan 19 08:57:34 2009 +0100
+++ b/common/mixins.py	Mon Jan 19 17:28:42 2009 +0100
@@ -165,7 +165,11 @@
     
     @property
     def state(self):
-        return self.in_state[0].name
+        try:
+            return self.in_state[0].name
+        except IndexError:
+            self.warning('entity %s has no state', self)
+            return None
     
     @property
     def displayable_state(self):