mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Adds try/catch block to allow method to fail open and log error.
This commit is contained in:
parent
e38f3ff56d
commit
8785523c72
1 changed files with 8 additions and 5 deletions
|
|
@ -216,13 +216,16 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
|
|||
@property
|
||||
def characters(self):
|
||||
# Get playable characters list
|
||||
objs = self.db._playable_characters
|
||||
if not objs: objs = ()
|
||||
objs = self.db._playable_characters or []
|
||||
|
||||
# Rebuild the list if legacy code left null values after deletion
|
||||
if None in objs:
|
||||
objs = [x for x in self.db._playable_characters if x]
|
||||
self.db._playable_characters = objs
|
||||
try:
|
||||
if None in objs:
|
||||
objs = [x for x in self.db._playable_characters if x]
|
||||
self.db._playable_characters = objs
|
||||
except Exception as e:
|
||||
logger.log_trace(e)
|
||||
logger.log_err(e)
|
||||
|
||||
return objs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue