Invalid command tab completion produces runtime error instead of warning

Typing axii asdf xyz and the tab produces the following ouput.

[▽ code] tobiasjacob@i61spc018:~/code$ axii asdf xzyTraceback (most recent call last):
  File "/home/tobiasjacob/git/axii/axii", line 7, in <module>
    entry_point()
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/core.py", line 1134, in __call__
    return self.main(*args, **kwargs)
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/core.py", line 1054, in main
    self._main_shell_completion(extra, prog_name, complete_var)
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/core.py", line 1129, in _main_shell_completion
    rv = shell_complete(self, ctx_args, prog_name, complete_var, instruction)
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/shell_completion.py", line 49, in shell_complete
    echo(comp.complete())
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/shell_completion.py", line 291, in complete
    completions = self.get_completions(args, incomplete)
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/shell_completion.py", line 271, in get_completions
    ctx = _resolve_context(self.cli, self.ctx_args, self.prog_name, args)
  File "/home/tobiasjacob/git/axii/.venv/lib/python3.10/site-packages/click/shell_completion.py", line 498, in _resolve_context
    name, cmd, args = command.resolve_command(ctx, args)
  File "/home/tobiasjacob/git/axii/armarx_setup/cli/common.py", line 126, in resolve_command
    return cmd.name, cmd, args
AttributeError: 'NoneType' object has no attribute 'name'

It should produce a nice error message instead.