From 817e5b65fea03dec8caf16da490b74c442d9230b Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 1 Mar 2005 21:35:23 +0000 Subject: [PATCH] if no params, send an empty array git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@138 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libstack/osrf_message.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libstack/osrf_message.c b/src/libstack/osrf_message.c index eb51063..ad57e92 100644 --- a/src/libstack/osrf_message.c +++ b/src/libstack/osrf_message.c @@ -104,10 +104,14 @@ osrf_message* osrf_message_init( enum M_TYPE type, int thread_trace, int protoco void osrf_message_set_request_info( osrf_message* msg, char* method_name, json* json_params ) { - if( msg == NULL || method_name == NULL || json_params == NULL ) + if( msg == NULL || method_name == NULL ) fatal_handler( "Bad params to osrf_message_set_request_params()" ); - msg->params = json_tokener_parse(json_object_to_json_string(json_params)); + if( json_params != NULL ) + msg->params = json_tokener_parse(json_object_to_json_string(json_params)); + else + msg->params = json_tokener_parse("[]"); + msg->method_name = strdup( method_name ); } -- 2.11.0