Merge pull request #3642 from InspectorCaracal/patch-33

Gracefully handle missing `caller.ndb._more` in `CmdMoreExit`
This commit is contained in:
Griatch 2024-11-11 20:20:07 +01:00 committed by GitHub
commit 8ed9377015
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,7 +79,7 @@ class CmdMore(Command):
Implement the command
"""
more = self.caller.ndb._more
if not more and inherits_from(self.caller, evennia.DefaultObject):
if not more and hasattr(self.caller, 'account') and self.caller.account:
more = self.caller.account.ndb._more
if not more:
self.caller.msg("Error in loading the pager. Contact an admin.")
@ -111,9 +111,13 @@ class CmdMoreExit(Command):
def func(self):
"""
Exit pager and re-fire the failed command.
"""
more = self.caller.ndb._more
if not more and hasattr(self.caller, 'account') and self.caller.account:
more = self.caller.account.ndb._more
if not more:
self.caller.msg("Error in exiting the pager. Contact an admin.")
return
more.page_quit()
# re-fire the command (in new cmdset)