From 43b0b1c16465ff2d75f1bb3dcb8902ba6b4d9831 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 28 Feb 2014 00:49:13 +0100 Subject: [PATCH] Fixed minor issue with bots executing commands --- src/players/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/players/models.py b/src/players/models.py index c4133f8bb3..f62fc8a233 100644 --- a/src/players/models.py +++ b/src/players/models.py @@ -434,7 +434,11 @@ class PlayerDB(TypedObject, AbstractUser): # in this case, we should either have only one sessid, or the sessid # should not matter (since the return goes to all of them we can # just use the first one as the source) - sessid = self.get_all_sessions()[0].sessid + try: + sessid = self.get_all_sessions()[0].sessid + except IndexError: + # this can happen for bots + sessid = None return cmdhandler.cmdhandler(self.typeclass, raw_string, callertype="player", sessid=sessid)