client API: check result ptr in mpv_command_node

This follows the docs, which say the result parameter is optional.
This commit is contained in:
James Ross-Gowan 2014-10-11 16:16:56 +11:00
parent e48b2bd4d1
commit 2782f06491
1 changed files with 1 additions and 1 deletions

View File

@ -883,7 +883,7 @@ int mpv_command(mpv_handle *ctx, const char **args)
int mpv_command_node(mpv_handle *ctx, mpv_node *args, mpv_node *result)
{
int r = run_client_command(ctx, mp_input_parse_cmd_node(ctx->log, args));
if (r >= 0)
if (result && r >= 0)
*result = (mpv_node){.format = MPV_FORMAT_NONE};
return r;
}