From 1ffdb9128d87dffe869c1e9f4024a16bfd0022c4 Mon Sep 17 00:00:00 2001 From: CogentRedTester Date: Wed, 22 Jun 2022 21:09:49 +0930 Subject: lua: command_native_async: make the callback optional The documentation states that the callback is optional, but it actually was not. Now it's optional, as docuented. --- player/lua/defaults.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua index dcbb4e0f62..e0914115f5 100644 --- a/player/lua/defaults.lua +++ b/player/lua/defaults.lua @@ -615,6 +615,7 @@ local async_next_id = 1 function mp.command_native_async(node, cb) local id = async_next_id async_next_id = async_next_id + 1 + cb = cb or function() end local res, err = mp.raw_command_native_async(id, node) if not res then mp.add_timeout(0, function() cb(false, nil, err) end) -- cgit v1.2.3