From 57615abd9b8c4d272e0e97ba1e9dec4bc3baf62f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 31 Jan 2011 17:26:29 +0100 Subject: [PATCH] make message data on invoke() optional --- libubus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libubus.c b/libubus.c index 1342ba1..fa7f5ca 100644 --- a/libubus.c +++ b/libubus.c @@ -444,7 +444,8 @@ void ubus_invoke_async(struct ubus_context *ctx, uint32_t obj, const char *metho blob_buf_init(&b, 0); blob_put_int32(&b, UBUS_ATTR_OBJID, obj); blob_put_string(&b, UBUS_ATTR_METHOD, method); - blob_put(&b, UBUS_ATTR_DATA, blob_data(msg), blob_len(msg)); + if (msg) + blob_put(&b, UBUS_ATTR_DATA, blob_data(msg), blob_len(msg)); ubus_start_request(ctx, req, b.head, UBUS_MSG_INVOKE, obj); } -- 2.25.1