From 199098c7f8d3018df8d064372ca5f80e6ad369c7 Mon Sep 17 00:00:00 2001 From: vyfor Date: Tue, 11 Feb 2025 14:53:55 +0500 Subject: [PATCH] fix(command): correctly handle autocompletion for commands without subcommands --- lua/cord/api/command.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cord/api/command.lua b/lua/cord/api/command.lua index 2c991c7e..e519e44a 100644 --- a/lua/cord/api/command.lua +++ b/lua/cord/api/command.lua @@ -215,7 +215,7 @@ end M.get_subcommands = function(cmd) local command = M.commands[cmd] - if not command or not command.subcommands then return {} end + if type(command) ~= 'table' or not command.subcommands then return {} end local subcmds = {} for subcmd, _ in pairs(command.subcommands) do