plugin: fix parsing libexec plugin output
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
3c55504336
commit
7fd4564b8a
1 changed files with 2 additions and 5 deletions
7
plugin.c
7
plugin.c
|
@ -108,12 +108,9 @@ rpc_plugin_call_finish_cb(struct blob_buf *blob, int stat, void *priv)
|
||||||
{
|
{
|
||||||
if (c->obj)
|
if (c->obj)
|
||||||
{
|
{
|
||||||
if (json_object_get_type(c->obj) == json_type_object ||
|
if (json_object_get_type(c->obj) == json_type_object &&
|
||||||
json_object_get_type(c->obj) == json_type_array)
|
blobmsg_add_object(blob, c->obj))
|
||||||
{
|
|
||||||
blobmsg_add_json_element(blob, NULL, c->obj);
|
|
||||||
rv = UBUS_STATUS_OK;
|
rv = UBUS_STATUS_OK;
|
||||||
}
|
|
||||||
|
|
||||||
json_object_put(c->obj);
|
json_object_put(c->obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue