Fix #1052 crash when issuing commands while not connected to a daemon

This commit is contained in:
Andrew Resch 2009-10-30 20:06:07 +00:00
parent a110ad1d20
commit 7c10dd4c0e
1 changed files with 4 additions and 0 deletions

View File

@ -275,6 +275,10 @@ class ConsoleUI(component.Component):
parser._print_help(f) parser._print_help(f)
parser.print_help = print_help parser.print_help = print_help
if not client.connected() and cmd not in ("connect", "quit"):
self.write("{!error!}Not connected to a daemon, please use the connect command first.")
return
try: try:
options, args = parser.parse_args(args) options, args = parser.parse_args(args)
except Exception, e: except Exception, e: