mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 12:56:30 +01:00
Merge pull request #2003 from strikaco/accountadmin
Fixes TypeError with Account characters property if unset
This commit is contained in:
commit
6effb6f456
1 changed files with 8 additions and 4 deletions
|
|
@ -216,12 +216,16 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
|
|||
@property
|
||||
def characters(self):
|
||||
# Get playable characters list
|
||||
objs = self.db._playable_characters
|
||||
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