Don't choke on empty command string

This commit is contained in:
Florian Bruhin 2014-01-30 11:51:56 +01:00
parent 330332da6d
commit 53861306ff

View File

@ -82,6 +82,8 @@ class CommandParser(QObject):
"""
self.text = text
parts = self.text.strip().split(maxsplit=1)
if not parts:
raise NoSuchCommandError
cmdstr = parts[0]
try:
cmd = cmd_dict[cmdstr]