Merge pull request #3642 from InspectorCaracal/patch-33
Gracefully handle missing `caller.ndb._more` in `CmdMoreExit`
This commit is contained in:
commit
8ed9377015
1 changed files with 6 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ class CmdMore(Command):
|
||||||
Implement the command
|
Implement the command
|
||||||
"""
|
"""
|
||||||
more = self.caller.ndb._more
|
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
|
more = self.caller.account.ndb._more
|
||||||
if not more:
|
if not more:
|
||||||
self.caller.msg("Error in loading the pager. Contact an admin.")
|
self.caller.msg("Error in loading the pager. Contact an admin.")
|
||||||
|
|
@ -111,9 +111,13 @@ class CmdMoreExit(Command):
|
||||||
def func(self):
|
def func(self):
|
||||||
"""
|
"""
|
||||||
Exit pager and re-fire the failed command.
|
Exit pager and re-fire the failed command.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
more = self.caller.ndb._more
|
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()
|
more.page_quit()
|
||||||
|
|
||||||
# re-fire the command (in new cmdset)
|
# re-fire the command (in new cmdset)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue