diff --git a/lua/orgmode/org/global.lua b/lua/orgmode/org/global.lua index 3c029f083..5e050c4dc 100644 --- a/lua/orgmode/org/global.lua +++ b/lua/orgmode/org/global.lua @@ -122,7 +122,7 @@ end vim.api.nvim_create_user_command('Org', function(opts) local item = resolve_item(opts.fargs) - if item and (type(item) == 'function' or getmetatable(item).__call) then + if item and (type(item) == 'function' or (getmetatable(item) and getmetatable(item).__call)) then return item() end require('orgmode.utils').echo_error(('Invalid command "Org %s"'):format(opts.args))