Fix command finding bug

This commit is contained in:
Richard Chien
2018-12-21 23:39:45 +08:00
parent 034f121cc0
commit f38c3e1c30
2 changed files with 5 additions and 1 deletions

View File

@ -164,7 +164,7 @@ def _find_command(name: Union[str, CommandName_T]) -> Optional[Command]:
cmd_tree = _registry
for part in cmd_name[:-1]:
if part not in cmd_tree:
if part not in cmd_tree or not isinstance(cmd_tree[part], dict):
return None
cmd_tree = cmd_tree[part]