Skip to content

Commit f0573ea

Browse files
committed
Add assert for config __call result
1 parent be1b630 commit f0573ea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lua/dap.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ function M.run(config, opts)
350350
local mt = getmetatable(config)
351351
if mt and type(mt.__call) == "function" then
352352
config = config()
353+
assert(config and type(config) == "table", "config metatable __call must return a config table")
353354
end
354355
config = vim.tbl_map(expand_config_variables, config)
355356
local adapter = M.adapters[config.type]

0 commit comments

Comments
 (0)