Commit f271a2ef authored by Pierre Ynard's avatar Pierre Ynard

luarc: fix interface crash on object command with missing arguments

parent e3f3421d
...@@ -650,10 +650,17 @@ function call_libvlc_command(cmd,client,arg) ...@@ -650,10 +650,17 @@ function call_libvlc_command(cmd,client,arg)
end end
function call_object_command(cmd,client,arg) function call_object_command(cmd,client,arg)
local var, val = split_input(arg) local var, val
if arg ~= nil then
var, val = split_input(arg)
end
local ok, vlcmsg, vlcerr, vlcerrmsg = pcall( vlc.var.command, cmd, var, val ) local ok, vlcmsg, vlcerr, vlcerrmsg = pcall( vlc.var.command, cmd, var, val )
if not ok then if not ok then
client:append("Error in `"..cmd.." "..var.." "..val.."' ".. vlcmsg) -- when pcall fails the 2nd arg is the error message local v = var or ""
if v ~= "" then v = " " .. v end
local v2 = val or ""
if v2 ~= "" then v2 = " " .. v2 end
client:append("Error in `"..cmd..v..v2.."' ".. vlcmsg) -- when pcall fails the 2nd arg is the error message
end end
if vlcmsg ~= "" then if vlcmsg ~= "" then
client:append(vlcmsg) client:append(vlcmsg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment