From f5caab093e3056affabfa668cbcfebce89c6d385 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 19 Aug 2012 21:36:01 +0200 Subject: [PATCH] Fixed a spurious error messages from the location setter when logging out (need to check None location) --- src/objects/models.py | 3 ++- src/utils/utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/objects/models.py b/src/objects/models.py index e85a0486a8..f68c4febee 100644 --- a/src/objects/models.py +++ b/src/objects/models.py @@ -285,7 +285,8 @@ class ObjectDB(TypedObject): # update the contents of each location if old_loc: old_loc.contents_update(self, remove=True) - loc.contents_update(self.typeclass) + if loc: + loc.contents_update(self.typeclass) except Exception: string = "Cannot set location: " string += "%s is not a valid location." diff --git a/src/utils/utils.py b/src/utils/utils.py index 0ede15fc2e..2d3570ec2b 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -394,7 +394,7 @@ def inherits_from(obj, parent): Takes an object and tries to determine if it inherits at any distance from parent. What differs this function from e.g. isinstance() is that obj may be both an instance and a class, and parent -< may be an instance, a class, or the python path to a class (counting + may be an instance, a class, or the python path to a class (counting from the evennia root directory). """