aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/menu.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept/menu.lua')
-rw-r--r--modules/textadept/menu.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index ea4b9db1..3a0348ab 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -379,9 +379,8 @@ end
events.connect(events.MENU_CLICKED, function(menu_id)
local actions = menu_id < 1000 and menu_actions or contextmenu_actions
local action = actions[menu_id < 1000 and menu_id or menu_id - 1000]
- if type(action) ~= 'function' and type(action) ~= 'table' then
- error(_L['Unknown command:']..' '..tostring(action))
- end
+ assert(type(action) == 'function' or type(action) == 'table',
+ _L['Unknown command:']..' '..tostring(action))
keys.run_command(action, type(action))
end)